:root {
  color-scheme: light dark;
  --page: #f5f5f7;
  --page-deep: #ececf0;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-muted: #eeeeF1;
  --surface-tint: #edf5ff;
  --line: rgba(29, 29, 31, .12);
  --line-soft: rgba(29, 29, 31, .07);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #86868b;
  --accent: #0071e3;
  --accent-dark: #005bb5;
  --accent-soft: #e8f2ff;
  --positive: #1f8f51;
  --positive-soft: #e8f7ed;
  --red: #c93434;
  --red-soft: #fff0f0;
  --orange: #986000;
  --shadow: 0 18px 50px rgba(29, 29, 31, .08);
  --shadow-small: 0 6px 20px rgba(29, 29, 31, .07);
  --radius: 16px;
  --radius-control: 12px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #111318;
    --page-deep: #191d24;
    --surface: rgba(29, 34, 42, .82);
    --surface-solid: #1d222a;
    --surface-muted: #252b34;
    --surface-tint: #162c45;
    --line: rgba(245, 247, 250, .16);
    --line-soft: rgba(245, 247, 250, .08);
    --text: #f5f7fa;
    --muted: #b6bbc5;
    --muted-2: #89919d;
    --accent: #4fa3ff;
    --accent-dark: #79b8ff;
    --accent-soft: #1b3655;
    --positive: #69d391;
    --positive-soft: #173a2b;
    --red: #ff9292;
    --red-soft: #45262b;
    --orange: #f2c46b;
    --shadow: 0 20px 60px rgba(0, 0, 0, .28);
    --shadow-small: 0 8px 24px rgba(0, 0, 0, .20);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 92% -12%, rgba(0, 113, 227, .08), transparent 28rem),
    radial-gradient(circle at -12% 30%, rgba(52, 199, 89, .055), transparent 24rem),
    var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .28;
  background: linear-gradient(90deg, rgba(255, 255, 255, .38), transparent 32%, transparent 68%, rgba(255, 255, 255, .28));
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { position: relative; overflow: hidden; cursor: pointer; }
button:disabled { cursor: wait; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100dvh; padding-bottom: 112px; animation: page-enter 420ms var(--ease-out) both; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 68px;
  padding: 0 clamp(20px, 5vw, 76px);
  border-bottom: 1px solid rgba(29, 29, 31, .09);
  background: rgba(245, 245, 247, .78);
  backdrop-filter: blur(24px) saturate(180%);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--text);
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -.045em;
  transition: opacity 160ms var(--ease-out);
}

.brand-mark:hover { opacity: .68; }
.brand-dot { width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52, 199, 89, .13); }
.brand-ai { color: var(--accent); }
.topbar-links { display: flex; align-items: center; gap: 28px; margin-left: auto; margin-right: 32px; }
.topbar-links a { color: var(--muted); font-size: 12px; font-weight: 600; transition: color 160ms var(--ease-out); }
.topbar-links a:hover { color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.live-pill { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.pulse, .status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52, 199, 89, .12); }
.icon-button, .close-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: rgba(255, 255, 255, .58);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 15px;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.icon-button:hover, .close-button:hover { color: var(--accent); border-color: rgba(0, 113, 227, .32); background: var(--accent-soft); transform: translateY(-1px); }

main { width: min(1160px, calc(100% - 48px)); margin: auto; }

.hero-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 455px);
  align-items: center;
  gap: clamp(46px, 8vw, 112px);
  min-height: 505px;
  padding: 78px 0 65px;
}

.hero-section::after {
  content: "";
  position: absolute;
  top: -175px;
  right: -265px;
  width: 500px;
  height: 500px;
  pointer-events: none;
  border: 1px solid rgba(0, 113, 227, .08);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(0, 113, 227, .025), 0 0 0 88px rgba(0, 113, 227, .018);
}

.hero-content { position: relative; z-index: 1; }
.hero-content > * { animation: hero-enter 460ms var(--ease-out) both; }
.hero-content > *:nth-child(2) { animation-delay: 45ms; }
.hero-content > *:nth-child(3) { animation-delay: 90ms; }
.hero-content > *:nth-child(4) { animation-delay: 135ms; }
.hero-content > *:nth-child(5) { animation-delay: 180ms; }
.eyebrow { margin: 0 0 13px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .15em; }
h1 { max-width: 680px; margin: 0; font-size: clamp(52px, 7vw, 82px); font-weight: 720; line-height: .94; letter-spacing: -.085em; }
h1 span { color: var(--accent); }
h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.055em; }
.hero-copy { max-width: 510px; margin: 25px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 30px; }
.hero-actions .primary-button { margin: 0; }
.primary-button span { margin-left: 8px; font-size: 15px; }
.hero-note { display: flex; align-items: center; gap: 7px; margin-top: 23px; color: var(--muted-2); font-size: 11px; }
.hero-note .status-dot { margin: 0; }
.hero-note-separator { color: #b5b5b9; }

.hero-visual {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  padding: 19px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 24px;
  background: #dfe7ec;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .7);
  isolation: isolate;
  animation: hero-visual-enter 560ms var(--ease-out) 70ms both;
}
.hero-photo, .hero-photo-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-photo { z-index: 0; object-fit: cover; object-position: center 48%; filter: saturate(.8) contrast(1.02); }
.hero-photo.image-failed { opacity: 0; }
.hero-photo-shade { z-index: 1; background: linear-gradient(180deg, rgba(15, 31, 44, .16), rgba(15, 31, 44, .48) 56%, rgba(15, 31, 44, .84)); }
.hero-visual::before { content: ""; position: absolute; z-index: 2; top: -120px; right: -105px; width: 270px; height: 270px; border-radius: 50%; background: rgba(0, 113, 227, .18); filter: blur(58px); }
.visual-grid { position: absolute; z-index: 2; inset: 0; opacity: .10; background-image: linear-gradient(rgba(255, 255, 255, .38) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .38) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(135deg, transparent, black 54%, transparent); }
.visual-topline, .visual-footer { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; color: rgba(255, 255, 255, .78); font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.visual-status { color: #d9f8e2; letter-spacing: .08em; }
.visual-status .pulse { margin-right: 6px; }
.court-mark { position: absolute; z-index: 3; top: 57px; right: 24px; width: 205px; height: 130px; border: 1px solid rgba(255, 255, 255, .44); opacity: .62; transform: perspective(310px) rotateX(35deg) rotateZ(-8deg); }
.court-mark::before, .court-mark::after { content: ""; position: absolute; left: 16%; right: 16%; height: 1px; background: rgba(255, 255, 255, .48); }
.court-mark::before { top: 28%; }
.court-mark::after { bottom: 28%; }
.court-net { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(255, 255, 255, .5); }
.court-center { position: absolute; top: 28%; bottom: 28%; left: 50%; border-left: 1px solid rgba(255, 255, 255, .5); }
.court-serve { position: absolute; top: 28%; bottom: 28%; width: 24%; border: 1px solid rgba(255, 255, 255, .5); }
.court-serve-left { left: 16%; border-left: 0; }
.court-serve-right { right: 16%; border-right: 0; }
.visual-metric { position: absolute; z-index: 4; bottom: 50px; left: 20px; display: flex; flex-direction: column; align-items: flex-start; }
.visual-label { color: rgba(255, 255, 255, .78); font-size: 9px; font-weight: 750; letter-spacing: .11em; }
.visual-metric strong { margin-top: 5px; color: #fff; font-size: 55px; font-weight: 720; line-height: .9; letter-spacing: -.09em; }
.visual-metric span:last-child { max-width: 220px; margin-top: 9px; color: rgba(255, 255, 255, .72); font-size: 10px; }
.visual-footer { position: absolute; right: 20px; bottom: 17px; left: 20px; color: rgba(255, 255, 255, .7); font-size: 10px; letter-spacing: 0; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.summary-card { min-height: 132px; padding: 19px; background: var(--surface); border: 1px solid rgba(29, 29, 31, .09); border-radius: var(--radius); box-shadow: var(--shadow-small); transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out), transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out); }
.summary-card:hover { border-color: rgba(0, 113, 227, .22); background: var(--surface-solid); box-shadow: 0 10px 28px rgba(29, 29, 31, .09); transform: translateY(-2px); }
.summary-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.summary-value { margin-top: 17px; color: var(--text); font-size: 33px; font-weight: 720; letter-spacing: -.075em; }
.summary-detail { margin-top: 6px; color: var(--muted-2); font-size: 11px; }

.story-rail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 10px; margin-top: 10px; }
.story-card, .spotlight-card { min-height: 238px; overflow: hidden; background: var(--surface); border: 1px solid rgba(29, 29, 31, .09); border-radius: var(--radius); box-shadow: var(--shadow-small); transition: border-color 200ms var(--ease-out), transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.story-card:hover, .spotlight-card:hover { border-color: rgba(0, 113, 227, .20); transform: translateY(-2px); box-shadow: var(--shadow); }
.story-card { display: grid; grid-template-columns: minmax(150px, .72fr) 1fr; }
.story-image, .spotlight-image { position: relative; min-width: 0; overflow: hidden; background: linear-gradient(135deg, #e6edf2, #dce8ef); }
.story-image img, .spotlight-image img { display: block; width: 100%; height: 100%; min-width: 0; object-fit: cover; color: transparent; font-size: 0; filter: saturate(.82) contrast(1.02); transition: transform 420ms var(--ease-out), filter 420ms var(--ease-out); }
.story-image img.image-failed, .spotlight-image img.image-failed { opacity: 0; }
.story-card:hover img, .spotlight-card:hover img { transform: scale(1.035); filter: saturate(.98); }
.story-image-awards img { object-position: center; }
.image-tag { position: absolute; bottom: 12px; left: 12px; padding: 6px 8px; color: #fff; background: rgba(29, 29, 31, .72); border: 1px solid rgba(255, 255, 255, .32); border-radius: 6px; font-size: 8px; font-weight: 750; letter-spacing: .10em; backdrop-filter: blur(8px); }
.story-copy, .spotlight-copy { min-width: 0; padding: 27px; }
.story-copy h2, .spotlight-copy h2 { max-width: 280px; font-size: 21px; line-height: 1.08; }
.story-copy p:not(.eyebrow), .spotlight-copy p:not(.eyebrow) { max-width: 335px; margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.inline-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 21px; color: var(--accent); font-size: 11px; font-weight: 700; }
.inline-link span { font-size: 15px; transition: transform 160ms var(--ease-out); }
.inline-link:hover span { transform: translate(2px, -2px); }
.spotlight-card { display: grid; grid-template-columns: 1fr minmax(120px, 37%); background: linear-gradient(135deg, rgba(238, 246, 255, .90), rgba(255, 255, 255, .88)); border-color: rgba(0, 113, 227, .15); }
.spotlight-copy { padding-right: 14px; }
.spotlight-image img { object-position: center 16%; }

.insight-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 10px; padding: 16px 18px; border: 1px solid rgba(0, 113, 227, .15); border-radius: var(--radius); background: var(--surface-tint); }
.insight-icon { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; background: var(--accent); border-radius: 10px; font-size: 16px; }
.insight-kicker { color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.insight-strip strong { display: block; margin-top: 4px; font-size: 13px; }
.insight-strip p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.insight-arrow { color: var(--accent); font-size: 19px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 78px 0 18px; scroll-margin-top: 88px; }
.last-updated, .record-note { color: var(--muted-2); font-size: 11px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 17px; }
.filter-chip { color: var(--muted); background: var(--surface-muted); border: 1px solid transparent; border-radius: 999px; padding: 9px 13px; font-size: 11px; transition: color 160ms var(--ease-out), background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.filter-chip:hover { color: var(--text); border-color: rgba(0, 113, 227, .18); transform: translateY(-1px); }
.filter-chip.active { color: var(--accent); background: var(--surface-solid); border-color: rgba(0, 113, 227, .18); box-shadow: 0 2px 8px rgba(29, 29, 31, .08); font-weight: 700; }
.filter-divider { width: 1px; height: 18px; margin: 0 5px; background: var(--line); }
.rankings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ranking-card { overflow: hidden; background: var(--surface); border: 1px solid rgba(29, 29, 31, .09); border-radius: var(--radius); box-shadow: var(--shadow-small); }
.ranking-card-head { display: flex; align-items: start; justify-content: space-between; padding: 19px 19px 16px; border-bottom: 1px solid var(--line-soft); }
.ranking-title { font-size: 14px; font-weight: 700; letter-spacing: -.02em; text-transform: capitalize; }
.ranking-subtitle { margin-top: 5px; color: var(--muted-2); font-size: 10px; }
.ranking-icon { color: var(--accent); font-size: 17px; }
.ranking-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 14px 19px; border-bottom: 1px solid var(--line-soft); transition: background 160ms var(--ease-out); }
.ranking-row:hover { background: rgba(0, 113, 227, .035); }
.ranking-row:last-child { border-bottom: 0; }
.rank-number { color: var(--muted-2); font-size: 11px; font-weight: 700; }
.rank-number.top { color: var(--accent); }
.rank-name { overflow: hidden; color: var(--text); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.rank-record { margin-top: 4px; color: var(--muted); font-size: 10px; }
.rank-diff { text-align: right; color: var(--positive); font-size: 11px; font-weight: 750; }
.rank-diff.negative { color: var(--red); }
.empty-state { padding: 27px 19px; color: var(--muted); font-size: 12px; }

.table-card, .matches-card, .data-panel { background: var(--surface); border: 1px solid rgba(29, 29, 31, .09); border-radius: var(--radius); box-shadow: var(--shadow-small); }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 700px; border-collapse: collapse; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
th { color: var(--muted-2); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
td { color: var(--muted); }
td.player-cell { color: var(--text); font-weight: 650; }
td.good { color: var(--positive); font-weight: 750; }
td.bad { color: var(--red); font-weight: 750; }
.recent-heading { margin-top: 62px; }
.matches-card { overflow: hidden; }
.match-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) 72px; align-items: center; gap: 14px; padding: 16px 19px; border-bottom: 1px solid var(--line-soft); }
.match-row:last-child { border-bottom: 0; }
.match-meta { color: var(--muted-2); font-size: 9px; font-weight: 700; line-height: 1.55; text-transform: uppercase; }
.match-players { overflow: hidden; color: var(--text); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.match-players span { padding: 0 5px; color: var(--muted-2); font-weight: 400; }
.match-score { color: var(--positive); font-size: 11px; font-weight: 750; text-align: right; }

.data-panel { margin: 62px 0 20px; padding: 29px; scroll-margin-top: 88px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(16px) saturate(150%); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; }
.close-button { width: 31px; height: 31px; font-size: 18px; line-height: 1; }
.panel-copy { max-width: 740px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.source-tabs { display: flex; gap: 4px; margin: 26px 0 19px; padding: 3px; width: fit-content; border-radius: 10px; background: var(--surface-muted); }
.source-tab { color: var(--muted); background: transparent; border: 0; border-radius: 8px; padding: 9px 12px; font-size: 11px; transition: color 160ms var(--ease-out), background 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.source-tab.active { color: var(--text); background: var(--surface-solid); box-shadow: 0 2px 6px rgba(29, 29, 31, .09); font-weight: 700; }
.source-view { display: none; }
.source-view.active { display: block; animation: source-enter 220ms var(--ease-out) both; }
label { display: block; margin: 12px 0 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.optional-label { color: var(--muted-2); font-weight: 500; }
.input-row { display: flex; gap: 8px; }
input, textarea, select { width: 100%; color: var(--text); background: rgba(255, 255, 255, .88); border: 1px solid rgba(29, 29, 31, .16); border-radius: 10px; padding: 12px 13px; outline: none; transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background 160ms var(--ease-out); }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
input::placeholder, textarea::placeholder { color: #9b9ba0; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(0, 113, 227, .12); }
select { max-width: 240px; }
.primary-button, .secondary-button, .ghost-button { border-radius: 10px; padding: 11px 16px; font-size: 11px; font-weight: 700; white-space: nowrap; transition: transform 160ms var(--ease-out), background 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.primary-button:active, .secondary-button:active, .ghost-button:active, .icon-button:active, .close-button:active, .filter-chip:active, .source-tab:active, .nav-item:active { transform: scale(.98); }
.is-loading { color: transparent !important; pointer-events: none; }
.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; color: var(--accent); animation: spin 700ms linear infinite; }
.primary-button { color: #fff; background: var(--accent); border: 1px solid var(--accent); box-shadow: 0 5px 14px rgba(0, 113, 227, .18); }
.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0, 113, 227, .22); }
.secondary-button { color: var(--text); background: var(--surface-muted); border: 1px solid transparent; margin-top: 10px; }
.secondary-button:hover { border-color: rgba(0, 113, 227, .20); background: var(--accent-soft); transform: translateY(-1px); }
.ghost-button { color: var(--muted); background: transparent; border: 1px solid rgba(29, 29, 31, .16); }
.ghost-button:hover { color: var(--text); border-color: rgba(0, 113, 227, .30); background: rgba(255, 255, 255, .64); }
.helper-text, .format-guide span { color: var(--muted-2); font-size: 11px; line-height: 1.6; }
.refresh-controls { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 25px; padding-top: 17px; border-top: 1px solid var(--line-soft); }
.refresh-controls label { margin-top: 0; }
.backend-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 16px 0 0; border-top: 1px solid var(--line-soft); }
.backend-row label { margin: 0 0 4px; }
.backend-row p { margin: 0; color: var(--muted-2); font-size: 11px; }
.backend-row p.connected { color: var(--positive); }
.backend-row p.error { color: var(--red); }
.format-guide { margin-top: 23px; padding: 15px; color: var(--muted); border: 1px dashed rgba(29, 29, 31, .20); border-radius: 11px; font-size: 11px; line-height: 1.65; }
.format-guide strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 11px; }
.format-guide code { display: block; overflow-x: auto; margin-bottom: 4px; color: var(--accent); font-size: 10px; white-space: nowrap; }
.status-message { min-height: 18px; margin-top: 12px; color: var(--positive); font-size: 11px; }
.status-message.error { color: var(--red); }
.analyzer-card { display: none; margin-top: 22px; padding: 18px; background: rgba(240, 240, 242, .72); border: 1px solid var(--line); border-radius: 13px; }
.analyzer-card.ready { display: block; animation: reveal 220ms var(--ease-out); }
.analyzer-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.analyzer-kicker { margin-bottom: 5px; color: var(--muted-2); font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.analyzer-header strong { font-size: 13px; }
.confidence-badge { flex: 0 0 auto; padding: 5px 8px; color: var(--muted-2); border: 1px solid var(--line); border-radius: 999px; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.confidence-badge.high { color: var(--positive); border-color: rgba(31, 143, 81, .25); background: var(--positive-soft); }
.confidence-badge.medium { color: var(--orange); border-color: rgba(152, 96, 0, .24); background: #fff7df; }
.confidence-badge.check { color: var(--red); border-color: rgba(201, 52, 52, .24); background: var(--red-soft); }
.analyzer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.analyzer-stat { display: flex; flex-direction: column; gap: 4px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 9px; background: rgba(255, 255, 255, .58); }
.analyzer-stat span { color: var(--muted-2); font-size: 9px; }
.analyzer-stat strong { font-size: 14px; }
.analyzer-fields { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.field-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; font-size: 9px; background: rgba(255, 255, 255, .54); }
.field-pill b { color: var(--accent); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.field-pill.muted { color: var(--muted-2); }
.analyzer-note { margin: 12px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.6; }

.reveal-on-scroll { opacity: 0; transform: translateY(10px); transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out); }
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
.stagger-item { animation: none; }
.content-swap { animation: content-swap 220ms var(--ease-out) both; }
.status-change { animation: status-change 180ms var(--ease-out) both; }
.is-ticking, .inline-ticker { font-variant-numeric: tabular-nums; }
.ripple { position: absolute; width: 16px; height: 16px; pointer-events: none; border-radius: 50%; background: currentColor; opacity: .16; transform: translate(-50%, -50%) scale(0); animation: ripple 420ms var(--ease-out) both; }

@keyframes page-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes hero-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hero-visual-enter { from { opacity: 0; transform: translateX(12px) scale(.99); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes source-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes content-swap { from { opacity: .52; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes status-change { from { opacity: .35; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ripple { to { opacity: 0; transform: translate(-50%, -50%) scale(15); } }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.bottom-nav { position: fixed; z-index: 10; right: 22px; bottom: 20px; left: auto; display: grid; grid-template-columns: repeat(4, 1fr); width: min(510px, calc(100% - 44px)); height: 60px; padding: 4px; background: rgba(255, 255, 255, .78); border: 1px solid rgba(29, 29, 31, .14); border-radius: 17px; backdrop-filter: blur(22px) saturate(180%); box-shadow: 0 18px 48px rgba(29, 29, 31, .15); }
.nav-item { color: var(--muted-2); background: transparent; border: 0; border-radius: 12px; font-size: 9px; font-weight: 700; transition: color 160ms var(--ease-out), background 160ms var(--ease-out); }
.nav-item span { display: block; margin-bottom: 2px; font-size: 17px; line-height: 20px; }
.nav-item.active, .nav-item:hover { color: var(--accent); background: var(--accent-soft); }
:focus-visible { outline: 3px solid rgba(0, 113, 227, .45); outline-offset: 3px; }

@media (min-width: 761px) { .bottom-nav { display: none; } }

@media (max-width: 900px) {
  .topbar-links { gap: 16px; margin-right: 18px; }
  .hero-section { gap: 44px; grid-template-columns: minmax(0, 1fr) minmax(330px, 42%); }
  .story-card { grid-template-columns: minmax(135px, .62fr) 1fr; }
}

@media (max-width: 760px) {
  main { width: min(100% - 30px, 600px); }
  .topbar { height: 64px; padding: 0 15px; }
  .topbar-links { display: none; }
  .topbar-actions { gap: 12px; }
  .hero-section { grid-template-columns: 1fr; gap: 31px; min-height: auto; padding: 61px 0 45px; }
  .hero-section::after { right: -290px; }
  .hero-visual { min-height: 270px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-card { min-height: 116px; padding: 15px; }
  .summary-value { margin-top: 14px; font-size: 28px; }
  .story-rail { grid-template-columns: 1fr; }
  .insight-strip { align-items: start; }
  .insight-arrow { align-self: center; }
  .rankings-grid { grid-template-columns: 1fr; }
  .section-heading { margin-top: 56px; }
  .filter-divider { display: none; }
  .match-row { grid-template-columns: 79px minmax(0, 1fr) 56px; gap: 8px; padding: 14px 13px; }
  .data-panel { padding: 20px; }
  .input-row { display: block; }
  .input-row .primary-button { width: 100%; margin-top: 8px; }
  .refresh-controls { display: block; }
  select { max-width: none; }
  .refresh-controls .secondary-button { width: 100%; }
  .backend-row { display: block; }
  .backend-row .secondary-button { width: 100%; }
  .bottom-nav { right: 15px; bottom: calc(10px + env(safe-area-inset-bottom)); width: calc(100% - 30px); }
}

@media (max-width: 440px) {
  .brand-mark { font-size: 15px; }
  .live-pill { display: none; }
  h1 { font-size: 51px; }
  .hero-copy { font-size: 14px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions button { width: 100%; }
  .hero-visual { min-height: 244px; }
  .court-mark { right: -26px; opacity: .46; }
  .visual-metric { bottom: 45px; left: 17px; }
  .visual-metric strong { font-size: 48px; }
  .insight-strip { grid-template-columns: auto 1fr; }
  .insight-arrow { display: none; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .record-note { display: none; }
  .analyzer-stats { grid-template-columns: 1fr; }
  .story-card { grid-template-columns: minmax(0, 43%) minmax(0, 1fr); }
  .spotlight-card { grid-template-columns: minmax(0, 1fr) minmax(0, 37%); }
  .story-copy, .spotlight-copy { padding: 19px; }
  .story-copy h2, .spotlight-copy h2 { font-size: 18px; }
  .story-copy p:not(.eyebrow), .spotlight-copy p:not(.eyebrow) { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal-on-scroll, .reveal-on-scroll.is-visible { opacity: 1; transform: none; }
  .stagger-item { animation: none; opacity: 1; transform: none; }
  .ripple { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .bottom-nav, .data-panel { background: var(--surface-solid); backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(29, 29, 31, .38); --line-soft: rgba(29, 29, 31, .22); --muted: #4f4f54; }
  input, textarea, select, .filter-chip, .primary-button, .secondary-button, .ghost-button { border-width: 2px; }
}

/* Apple-adjacent frosted material approximation for the web. */
body {
  background:
    radial-gradient(circle at 88% -8%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 28rem),
    radial-gradient(circle at -10% 38%, color-mix(in srgb, var(--positive) 7%, transparent), transparent 25rem),
    var(--page);
}

body::after {
  opacity: .14;
  background: linear-gradient(90deg, color-mix(in srgb, var(--surface-solid) 48%, transparent), transparent 32%, transparent 68%, color-mix(in srgb, var(--surface-solid) 36%, transparent));
}

.topbar {
  border-bottom-color: var(--line-soft);
  background: var(--surface);
}

.icon-button, .close-button {
  width: auto;
  min-width: 44px;
  padding: 0 11px;
  border-radius: var(--radius-control);
  background: var(--surface);
}

.close-button {
  min-width: 48px;
  font-size: 11px;
  font-weight: 700;
}

.icon-button:hover, .close-button:hover {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--line));
  background: var(--accent-soft);
}

.hero-section {
  min-height: min(650px, calc(100dvh - 68px));
  padding-top: 72px;
  padding-bottom: 56px;
}

.hero-visual {
  border-color: var(--line);
  background: var(--page-deep);
  border-radius: 22px;
}

.hero-photo {
  filter: saturate(.78) contrast(1.04);
}

.hero-photo.image-failed {
  opacity: 0;
}

.story-card, .spotlight-card, .summary-card, .ranking-card, .table-card, .matches-card, .data-panel {
  border-color: var(--line-soft);
}

.story-image, .spotlight-image {
  background: var(--page-deep);
}

.story-kicker {
  margin: 0 0 11px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.story-copy p:not(.story-kicker), .spotlight-copy p:not(.story-kicker) {
  max-width: 335px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.inline-link {
  gap: 0;
  padding-bottom: 3px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
}

.spotlight-card {
  background: var(--surface-tint);
}

.insight-strip {
  grid-template-columns: 1fr;
  gap: 0;
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
}

.section-heading {
  margin-top: 70px;
}

.filter-chip {
  border-color: transparent;
}

.filter-chip.active {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.ranking-card, .table-card, .matches-card, .data-panel {
  box-shadow: var(--shadow-small);
}

.data-panel {
  background: var(--surface);
}

input, textarea, select {
  background: var(--surface-solid);
  border-color: var(--line);
}

input:focus, textarea:focus, select:focus {
  background: var(--surface-solid);
}

.primary-button, .secondary-button, .ghost-button {
  border-radius: var(--radius-control);
}

.secondary-button {
  border-color: var(--line-soft);
}

.ghost-button:hover {
  background: var(--surface);
}

.source-tabs {
  border-radius: var(--radius-control);
}

.source-tab {
  border-radius: 9px;
}

.source-view[hidden] {
  display: none;
}

.analyzer-card {
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
}

.analyzer-stat, .field-pill {
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
}

.confidence-badge.medium {
  background: var(--surface-muted);
}

.bottom-nav {
  background: var(--surface);
  border-color: var(--line);
}

.nav-item {
  display: grid;
  place-items: center;
  padding: 0 5px;
  font-size: 10px;
}

.nav-item span {
  display: none;
}

@media (max-width: 760px) {
  .hero-section {
    min-height: auto;
    padding-top: 58px;
  }

  .hero-visual {
    min-height: 286px;
  }

  .story-card, .spotlight-card {
    min-height: 250px;
  }
}

/* Phosphor icon treatment. Keep labels visible so the interface remains usable
   if the external icon stylesheet is unavailable. */
.ph,
.ph-fill {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 1.08em;
  line-height: 1;
  vertical-align: -0.12em;
}

.topbar-links a,
.icon-button,
.close-button,
.primary-button,
.secondary-button,
.ghost-button,
.source-tab,
.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-links a .ph {
  font-size: 16px;
}

.live-pill {
  gap: 6px;
}

.live-pill .ph-fill {
  font-size: 15px;
}

.icon-button .ph,
.close-button .ph {
  font-size: 18px;
}

.primary-button > span,
.secondary-button > span,
.ghost-button > span {
  margin-left: 0;
}

.inline-link .ph {
  font-size: 16px;
  transition: transform 180ms var(--ease-out);
}

.inline-link:hover .ph {
  transform: translate(2px, -2px);
}

.insight-kicker,
.summary-label,
.match-meta,
.match-score {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.insight-kicker .ph-fill {
  font-size: 16px;
}

.summary-label .ph {
  font-size: 18px;
}

.ranking-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ranking-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--coral);
  background: color-mix(in srgb, var(--coral) 12%, transparent);
  border-radius: 50%;
}

.ranking-icon .ph {
  font-size: 18px;
}

.match-meta {
  align-items: flex-start;
}

.match-meta .ph {
  margin-top: 1px;
  font-size: 15px;
}

.match-score {
  justify-content: flex-end;
}

.match-score .ph-fill {
  font-size: 16px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.nav-item > span {
  display: block;
  margin: 0;
  font-size: 10px;
  line-height: 1.1;
}

.nav-item .ph {
  margin: 0;
  font-size: 20px;
}

@media (max-width: 440px) {
  .story-copy p:not(.story-kicker), .spotlight-copy p:not(.story-kicker) {
    font-size: 11px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(29, 29, 31, .38);
    --line-soft: rgba(29, 29, 31, .22);
    --muted: #4f4f54;
  }
}

@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  :root {
    --line: rgba(245, 247, 250, .40);
    --line-soft: rgba(245, 247, 250, .22);
    --muted: #d0d5dd;
  }
}

/* Airtable-inspired editorial layer. The document structure stays product-first:
   rankings, players, matches, and import remain in their existing order. */
:root {
  color-scheme: light dark;
  --page: #ffffff;
  --page-deep: #f8fafc;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-muted: #f8fafc;
  --surface-tint: #f5e9d4;
  --surface-dark: #181d26;
  --surface-dark-elevated: #1d1f25;
  --line: #dddddd;
  --line-soft: #ededed;
  --text: #181d26;
  --muted: #333840;
  --muted-2: #41454d;
  --accent: #1b61c9;
  --accent-dark: #1a3866;
  --accent-soft: #eef4ff;
  --primary-action: #181d26;
  --primary-action-active: #0d1218;
  --primary-action-text: #ffffff;
  --positive: #006400;
  --positive-soft: #edf7ed;
  --red: #aa2d00;
  --red-soft: #fff1eb;
  --orange: #8a5a00;
  --coral: #aa2d00;
  --forest: #0a2e0e;
  --cream: #f5e9d4;
  --peach: #fcab79;
  --mint: #a8d8c4;
  --yellow: #f4d35e;
  --mustard: #d9a441;
  --on-dark: #ffffff;
  --shadow: none;
  --shadow-small: none;
  --radius: 12px;
  --radius-control: 6px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

body {
  color: var(--text);
  background: var(--page);
  font-family: "Haas Groot Disp", "Haas", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
}

body::after,
.hero-section::after,
.hero-visual::before,
.visual-grid {
  display: none;
}

.app-shell {
  background: var(--page);
  animation: editorial-page-enter 520ms var(--ease-out) both;
}

.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: var(--page);
  backdrop-filter: none;
}

.brand-mark {
  font-weight: 500;
  letter-spacing: -.035em;
}

.brand-dot {
  width: 7px;
  height: 7px;
  margin-right: 9px;
  box-shadow: none;
}

.brand-ai {
  color: var(--accent);
}

.topbar-links {
  gap: 25px;
}

.topbar-links a,
.live-pill {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}

.topbar-links a:hover {
  color: var(--accent-dark);
}

.topbar-actions {
  gap: 14px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
}

.pulse,
.status-dot {
  box-shadow: none;
}

.icon-button,
.close-button {
  min-width: 44px;
  height: 40px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
}

.icon-button:hover,
.close-button:hover {
  color: var(--text);
  border-color: var(--text);
  background: var(--surface-muted);
  transform: translateY(-1px);
}

main {
  width: min(1160px, calc(100% - 48px));
}

.hero-section {
  min-height: min(650px, calc(100dvh - 64px));
  padding: 96px 0;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
}

h1 {
  max-width: 620px;
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -.055em;
}

h1 span {
  color: var(--coral);
}

h2 {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.hero-copy {
  max-width: 500px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.hero-actions {
  gap: 12px;
  margin-top: 32px;
}

.hero-note {
  margin-top: 24px;
  color: var(--muted-2);
  font-size: 12px;
}

.hero-note-separator {
  color: var(--line);
}

.hero-visual {
  min-height: 340px;
  padding: 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-dark);
  box-shadow: none;
}

.hero-photo-shade {
  background: rgba(24, 29, 38, .50);
}

.visual-topline,
.visual-footer {
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
}

.visual-status {
  color: var(--mint);
  letter-spacing: .02em;
}

.court-mark {
  opacity: .48;
}

.visual-metric strong {
  font-size: 54px;
  font-weight: 400;
  letter-spacing: -.07em;
}

.visual-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
}

.summary-grid {
  gap: 16px;
  margin-top: 0;
}

.summary-card {
  min-height: 132px;
  padding: 24px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-muted);
  box-shadow: none;
}

.summary-card:nth-child(2) { background: var(--mint); }
.summary-card:nth-child(3) { background: var(--cream); }
.summary-card:nth-child(4) { background: var(--peach); }

.summary-card:hover {
  border-color: transparent;
  background: var(--surface-muted);
  box-shadow: none;
  transform: translateY(-3px);
}

.summary-card:nth-child(2):hover { background: var(--mint); }
.summary-card:nth-child(3):hover { background: var(--cream); }
.summary-card:nth-child(4):hover { background: var(--peach); }

.summary-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.summary-value {
  margin-top: 20px;
  color: var(--text);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -.055em;
}

.summary-detail {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.story-rail {
  gap: 16px;
  margin-top: 16px;
}

.story-card,
.spotlight-card {
  min-height: 256px;
  border: 0;
  border-radius: var(--radius);
  box-shadow: none;
}

.story-card {
  background: var(--coral);
}

.spotlight-card {
  background: var(--forest);
}

.story-image,
.spotlight-image {
  background: rgba(255, 255, 255, .12);
}

.story-image img,
.spotlight-image img {
  filter: saturate(.78) contrast(1.04);
}

.story-copy,
.spotlight-copy {
  padding: 32px;
}

.story-kicker {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.story-copy h2,
.spotlight-copy h2 {
  max-width: 300px;
  color: #ffffff;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -.035em;
}

.story-copy p:not(.eyebrow),
.spotlight-copy p:not(.eyebrow),
.story-copy p:not(.story-kicker),
.spotlight-copy p:not(.story-kicker) {
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  line-height: 1.5;
}

.inline-link {
  margin-top: 22px;
  padding-bottom: 3px;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, .55);
  font-size: 14px;
  font-weight: 500;
}

.story-card:hover,
.spotlight-card:hover {
  border-color: transparent;
  box-shadow: none;
  transform: translateY(-4px);
}

.insight-strip {
  gap: 0;
  margin-top: 16px;
  padding: 24px;
  border: 0;
  border-radius: 10px;
  background: var(--cream);
}

.insight-strip .insight-kicker {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.insight-strip strong {
  margin-top: 7px;
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
}

.insight-strip p {
  color: var(--muted);
  font-size: 14px;
}

.section-heading {
  margin-top: 96px;
  margin-bottom: 24px;
}

.last-updated,
.record-note {
  color: var(--muted-2);
  font-size: 14px;
}

.filter-bar {
  gap: 8px;
  margin-bottom: 20px;
}

.filter-chip {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 10px 14px;
  font-size: 14px;
  transition: color 180ms var(--ease-out), background 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--text);
}

.filter-chip.active {
  color: #ffffff;
  background: var(--primary-action);
  border-color: var(--primary-action);
  box-shadow: none;
  font-weight: 500;
}

.filter-divider {
  height: 24px;
  margin: 0 5px;
  background: var(--line);
}

.rankings-grid {
  gap: 16px;
}

.ranking-card,
.table-card,
.matches-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.ranking-card-head {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.ranking-title {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.02em;
}

.ranking-subtitle {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 13px;
}

.ranking-row {
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.ranking-row:hover {
  background: var(--surface-muted);
}

.rank-number,
.rank-diff {
  font-size: 14px;
  font-weight: 500;
}

.rank-number.top {
  color: var(--coral);
}

.rank-name {
  font-size: 14px;
  font-weight: 500;
}

.rank-record {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 32px 24px;
  color: var(--muted);
  font-size: 14px;
}

.table-card,
.matches-card {
  overflow: hidden;
}

th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

th {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

td {
  color: var(--muted);
}

td.player-cell {
  color: var(--text);
  font-weight: 500;
}

td.good {
  color: var(--positive);
  font-weight: 500;
}

td.bad {
  color: var(--red);
  font-weight: 500;
}

.recent-heading {
  margin-top: 96px;
}

.match-row {
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.match-meta {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
}

.match-players {
  font-size: 14px;
  font-weight: 500;
}

.match-score {
  color: var(--positive);
  font-size: 14px;
  font-weight: 500;
}

.data-panel {
  margin: 96px 0 20px;
  padding: 48px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-dark);
  color: var(--on-dark);
  box-shadow: none;
  backdrop-filter: none;
}

.data-panel h2,
.data-panel .panel-copy,
.data-panel label,
.data-panel .backend-row p,
.data-panel .helper-text,
.data-panel .format-guide,
.data-panel .analyzer-note {
  color: rgba(255, 255, 255, .78);
}

.data-panel h2 {
  color: #ffffff;
}

.data-panel .eyebrow,
.data-panel .analyzer-kicker {
  color: rgba(255, 255, 255, .66);
}

.data-panel .close-button,
.data-panel .primary-button,
.data-panel .secondary-button {
  color: var(--text);
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: none;
}

.data-panel .close-button:hover,
.data-panel .primary-button:hover,
.data-panel .secondary-button:hover {
  background: var(--cream);
  border-color: var(--cream);
  transform: translateY(-1px);
}

.source-tabs {
  margin: 32px 0 24px;
  padding: 4px;
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, .10);
}

.source-tab {
  color: rgba(255, 255, 255, .72);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 14px;
}

.source-tab.active {
  color: var(--text);
  background: #ffffff;
  box-shadow: none;
  font-weight: 500;
}

input,
textarea,
select {
  min-height: 44px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 12px 16px;
}

textarea {
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

input::placeholder,
textarea::placeholder {
  color: #66707c;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #458fff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(69, 143, 255, .24);
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border-radius: var(--radius-control);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
}

.primary-button {
  color: var(--primary-action-text);
  background: var(--primary-action);
  border: 1px solid var(--primary-action);
  box-shadow: none;
}

.primary-button:hover {
  background: var(--primary-action-active);
  border-color: var(--primary-action-active);
  box-shadow: none;
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
}

.secondary-button:hover,
.ghost-button:hover {
  color: var(--text);
  background: var(--surface-muted);
  border-color: var(--text);
  transform: translateY(-1px);
}

.refresh-controls,
.backend-row {
  border-top-color: rgba(255, 255, 255, .18);
}

.backend-row p.connected,
.data-panel .status-message {
  color: var(--mint);
}

.backend-row p.error,
.data-panel .status-message.error {
  color: var(--peach);
}

.format-guide {
  border-color: rgba(255, 255, 255, .32);
  border-radius: 6px;
}

.format-guide strong {
  color: #ffffff;
}

.format-guide code {
  color: var(--mint);
}

.analyzer-card {
  background: var(--surface-dark-elevated);
  border-color: rgba(255, 255, 255, .16);
  border-radius: 10px;
}

.analyzer-stat,
.field-pill {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .14);
}

.analyzer-stat span,
.field-pill,
.confidence-badge {
  color: rgba(255, 255, 255, .70);
}

.analyzer-stat strong {
  color: #ffffff;
}

.field-pill b {
  color: var(--mint);
}

.confidence-badge {
  border-color: rgba(255, 255, 255, .18);
  border-radius: 6px;
}

.confidence-badge.high {
  color: var(--mint);
  border-color: rgba(168, 216, 196, .46);
  background: rgba(168, 216, 196, .10);
}

.confidence-badge.medium {
  color: var(--yellow);
  border-color: rgba(244, 211, 94, .44);
  background: rgba(244, 211, 94, .10);
}

.confidence-badge.check {
  color: var(--peach);
  border-color: rgba(252, 171, 121, .44);
  background: rgba(252, 171, 121, .10);
}

.reveal-on-scroll {
  transform: translateY(16px);
  transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out);
}

.stagger-item {
  animation: editorial-stagger 520ms var(--ease-out) both;
  animation-delay: calc(var(--stagger-index, 0) * 42ms);
}

.content-swap {
  animation: editorial-content-swap 360ms var(--ease-out) both;
}

.status-change {
  animation: editorial-status-change 240ms var(--ease-out) both;
}

.ripple {
  background: currentColor;
}

.bottom-nav {
  background: var(--surface);
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(24, 29, 38, .14);
  backdrop-filter: none;
}

.nav-item {
  color: var(--muted-2);
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
}

.nav-item.active,
.nav-item:hover {
  color: #ffffff;
  background: var(--primary-action);
}

:focus-visible {
  outline-color: #458fff;
}

@keyframes editorial-page-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes editorial-stagger {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes editorial-content-swap {
  from { opacity: .55; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes editorial-status-change {
  from { opacity: .45; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .hero-section {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .story-card,
  .spotlight-card {
    grid-template-columns: 1fr;
  }

  .story-image,
  .spotlight-image {
    min-height: 168px;
  }

  .story-copy,
  .spotlight-copy {
    padding: 28px;
  }

  .summary-card {
    padding: 20px;
  }

  .section-heading,
  .recent-heading {
    margin-top: 72px;
  }

  .data-panel {
    padding: 28px 20px;
  }
}

@media (max-width: 440px) {
  h1 {
    font-size: 48px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-visual {
    min-height: 260px;
  }

  .story-copy,
  .spotlight-copy {
    padding: 24px;
  }

  .story-copy h2,
  .spotlight-copy h2 {
    font-size: 24px;
  }

  .match-row {
    grid-template-columns: 70px minmax(0, 1fr) 52px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #14171d;
    --page-deep: #1d1f25;
    --surface: #1d1f25;
    --surface-solid: #23262d;
    --surface-muted: #272b32;
    --surface-tint: #3b3126;
    --line: rgba(255, 255, 255, .18);
    --line-soft: rgba(255, 255, 255, .10);
    --text: #f5f7fa;
    --muted: #d4d7dc;
    --muted-2: #adb2bc;
    --accent: #7fb1ff;
    --accent-dark: #c5dcff;
    --accent-soft: #233654;
    --primary-action: #f5f7fa;
    --primary-action-active: #ffffff;
    --primary-action-text: #181d26;
    --positive: #a8d8c4;
    --positive-soft: #1f3b2b;
    --red: #fcab79;
    --red-soft: #45291f;
    --orange: #f4d35e;
  }

  .summary-card,
  .summary-card:nth-child(2),
  .summary-card:nth-child(3),
  .summary-card:nth-child(4) {
    background: var(--surface);
    border: 1px solid var(--line-soft);
  }

  .insight-strip {
    background: var(--surface-tint);
  }

  .insight-strip strong,
  .insight-strip p,
  .insight-strip .insight-kicker {
    color: var(--text);
  }

  input,
  textarea,
  select,
  .secondary-button,
  .ghost-button {
    background: var(--surface-solid);
    color: var(--text);
    border-color: var(--line);
  }

  input::placeholder,
  textarea::placeholder {
    color: #a9b0ba;
  }

  .filter-chip {
    background: var(--surface);
    color: var(--muted);
  }

  .filter-chip.active,
  .nav-item.active,
  .nav-item:hover {
    color: var(--primary-action-text);
    background: var(--primary-action);
    border-color: var(--primary-action);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stagger-item,
  .content-swap,
  .status-change,
  .app-shell {
    animation: none;
  }

  .story-card:hover,
  .spotlight-card:hover,
  .summary-card:hover,
  .primary-button:hover,
  .secondary-button:hover,
  .ghost-button:hover {
    transform: none;
  }
}

/* Poly-inspired court layer: warm hero photography, translucent navigation,
   and a floating control dock over the existing ranking workflow. */
:root {
  color-scheme: light;
  --page: #f3ede6;
  --page-deep: #e8ded4;
  --surface: rgba(255, 251, 247, .78);
  --surface-solid: #fffaf5;
  --surface-muted: #e9dfd6;
  --surface-tint: #ffeadc;
  --surface-dark: #201815;
  --surface-dark-elevated: #30221d;
  --line: rgba(48, 35, 28, .16);
  --line-soft: rgba(48, 35, 28, .09);
  --text: #241b17;
  --muted: #6f625b;
  --muted-2: #8d7f75;
  --accent: #ef5b3e;
  --accent-dark: #c9422d;
  --accent-soft: #ffe1d5;
  --primary-action: #30221d;
  --primary-action-active: #1f1511;
  --primary-action-text: #fffaf5;
  --positive: #38795e;
  --positive-soft: #e6f1e9;
  --red: #b33e32;
  --red-soft: #ffebe6;
  --orange: #a96b24;
  --coral: #e85236;
  --forest: #183c32;
  --cream: #f6d6bd;
  --peach: #f8a47c;
  --mint: #b9d8c5;
  --yellow: #f4d35e;
  --shadow: 0 22px 70px rgba(70, 44, 29, .16);
  --shadow-small: 0 10px 30px rgba(70, 44, 29, .10);
  --radius: 20px;
  --radius-control: 13px;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 12% 3%, rgba(255, 255, 255, .62), transparent 24rem),
    radial-gradient(circle at 94% 18%, rgba(239, 91, 62, .11), transparent 28rem),
    var(--page);
  font-family: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
}

body::after {
  z-index: -1;
  opacity: .18;
  background-image: radial-gradient(rgba(36, 27, 23, .20) .6px, transparent .6px);
  background-size: 5px 5px;
  mix-blend-mode: multiply;
}

.app-shell {
  padding-bottom: 142px;
  animation: page-enter 650ms var(--ease-out) both;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  height: 78px;
  padding: 0 clamp(20px, 5vw, 58px);
  color: #fffaf5;
  border-bottom-color: transparent;
  background: transparent;
  backdrop-filter: none;
  transition: color 220ms var(--ease-out), background 220ms var(--ease-out), border-color 220ms var(--ease-out), box-shadow 220ms var(--ease-out);
}

.topbar.is-scrolled {
  color: var(--text);
  border-bottom-color: var(--line-soft);
  background: rgba(243, 237, 230, .88);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 8px 28px rgba(70, 44, 29, .08);
}

.brand-mark,
.topbar-links a,
.live-pill {
  color: inherit;
}

.brand-mark {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.045em;
}

.brand-mark:hover,
.topbar-links a:hover {
  color: inherit;
  opacity: .72;
}

.brand-dot {
  width: 8px;
  height: 8px;
  margin-right: 9px;
  background: #ffd36b;
  box-shadow: 0 0 0 4px rgba(255, 211, 107, .18);
}

.brand-ai { color: #ffd36b; }
.topbar.is-scrolled .brand-ai { color: var(--accent); }

.topbar-links {
  gap: 24px;
  margin-right: 26px;
}

.topbar-links a,
.live-pill {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}

.topbar.is-scrolled .brand-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.topbar.is-scrolled .live-pill .ph-fill { color: var(--positive); }

.icon-button,
.close-button {
  color: inherit;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .34);
  box-shadow: 0 6px 20px rgba(20, 13, 10, .08);
}

.icon-button:hover,
.close-button:hover {
  color: inherit;
  border-color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .26);
}

.topbar.is-scrolled .icon-button,
.topbar.is-scrolled .close-button {
  color: var(--text);
  background: rgba(255, 251, 247, .58);
  border-color: var(--line);
}

.topbar.is-scrolled .icon-button:hover,
.topbar.is-scrolled .close-button:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
  background: var(--accent-soft);
}

main { width: min(1160px, calc(100% - 48px)); }

.hero-section {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-height: min(760px, 100dvh);
  margin-left: calc(50% - 50vw);
  padding: 148px 24px 164px;
  text-align: center;
}

.hero-section::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(25, 17, 14, .26), rgba(25, 17, 14, .46) 48%, rgba(25, 17, 14, .82));
}

.hero-section::after { display: none; }

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 860px;
  text-align: center;
}

.hero-content > * { position: relative; z-index: 5; }
.hero-section .eyebrow { color: rgba(255, 250, 245, .78); }

h1 {
  max-width: 880px;
  color: #fffaf5;
  font-size: clamp(58px, 8vw, 108px);
  font-weight: 450;
  line-height: .94;
  letter-spacing: -.075em;
  text-wrap: balance;
}

h1 span {
  position: relative;
  display: inline-block;
  color: #ffd28d;
}

h1 span::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -.15em;
  left: -2px;
  height: .24em;
  border-bottom: 3px solid rgba(255, 210, 141, .84);
  border-radius: 50%;
  transform: rotate(-1.5deg);
}

.hero-copy {
  max-width: 600px;
  margin-top: 26px;
  color: rgba(255, 250, 245, .82);
  font-size: 16px;
  line-height: 1.55;
  text-wrap: balance;
}

.hero-actions { justify-content: center; margin-top: 32px; }
.hero-note { color: rgba(255, 250, 245, .72); }
.hero-note-separator { color: rgba(255, 250, 245, .42); }
.hero-note .status-dot { background: #c8ec9c; box-shadow: 0 0 0 4px rgba(200, 236, 156, .14); }

.hero-visual {
  position: absolute;
  z-index: 0;
  inset: 0;
  min-height: 100%;
  padding: 26px clamp(22px, 5vw, 64px);
  border: 0;
  border-radius: 0;
  background: #49342b;
  box-shadow: none;
  animation: none;
}

.hero-photo {
  filter: saturate(.78) contrast(1.08) brightness(.68);
  object-position: center 46%;
}

.hero-photo-shade {
  background: linear-gradient(180deg, rgba(32, 20, 16, .08), rgba(32, 20, 16, .26) 34%, rgba(32, 20, 16, .72));
}

.hero-visual::before {
  top: 8%;
  right: 14%;
  width: 350px;
  height: 350px;
  background: rgba(240, 139, 82, .20);
  filter: blur(90px);
}

.visual-grid { opacity: .08; background-size: 48px 48px; }
.visual-topline { font-size: 10px; letter-spacing: .13em; }
.visual-status { color: #d8f4bf; }
.visual-metric { bottom: 70px; left: clamp(22px, 5vw, 64px); text-align: left; }
.visual-metric strong { font-size: 64px; }
.visual-footer { right: clamp(22px, 5vw, 64px); bottom: 26px; left: clamp(22px, 5vw, 64px); }

.court-mark { top: 28%; right: 17%; opacity: .23; transform: perspective(310px) rotateX(35deg) rotateZ(-8deg) scale(1.25); }

.racket-art {
  position: absolute;
  z-index: 3;
  top: 15%;
  right: 9%;
  width: 190px;
  height: 380px;
  pointer-events: none;
  opacity: .86;
  transform: perspective(760px) rotateZ(23deg) rotateY(-16deg);
  transform-style: preserve-3d;
  filter: drop-shadow(20px 24px 19px rgba(18, 10, 7, .27));
  animation: racket-float 6s ease-in-out infinite;
}

.racket-head {
  position: absolute;
  top: 0;
  left: 15px;
  width: 168px;
  height: 218px;
  overflow: hidden;
  border: 10px solid rgba(255, 239, 210, .92);
  border-radius: 48% 48% 44% 44%;
  background: rgba(55, 30, 22, .26);
  box-shadow: inset 7px 0 0 rgba(255, 255, 255, .12), inset -8px -4px 0 rgba(80, 28, 18, .38), 0 0 0 2px rgba(239, 91, 62, .72);
  transform: translateZ(16px) rotateX(8deg);
}

.racket-head::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background-image: linear-gradient(90deg, transparent 48%, rgba(255, 241, 213, .62) 49%, rgba(255, 241, 213, .62) 51%, transparent 52%), linear-gradient(0deg, transparent 48%, rgba(255, 241, 213, .62) 49%, rgba(255, 241, 213, .62) 51%, transparent 52%);
  background-size: 21px 21px;
  box-shadow: inset 0 0 18px rgba(255, 222, 164, .16);
  opacity: .74;
}

.racket-head::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 232, 195, .45);
  border-radius: inherit;
}

.racket-head-glow {
  position: absolute;
  top: 22px;
  left: 26px;
  width: 46px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .20);
  filter: blur(16px);
  transform: rotate(14deg);
}

.racket-throat {
  position: absolute;
  top: 188px;
  left: 74px;
  width: 49px;
  height: 58px;
  border-right: 7px solid rgba(255, 239, 210, .88);
  border-bottom: 7px solid rgba(255, 239, 210, .88);
  border-radius: 0 0 24px 0;
  transform: skewX(-11deg) rotate(6deg) translateZ(10px);
}

.racket-shaft {
  position: absolute;
  top: 226px;
  left: 91px;
  width: 19px;
  height: 102px;
  border-radius: 10px;
  background: linear-gradient(90deg, #f2c99a, #fff0ca 36%, #a94b35 70%, #723225);
  box-shadow: inset 2px 0 rgba(255, 255, 255, .45), inset -3px 0 rgba(63, 20, 15, .34);
  transform: rotate(6deg) translateZ(8px);
}

.racket-grip {
  position: absolute;
  top: 307px;
  left: 86px;
  width: 30px;
  height: 70px;
  border-radius: 9px 9px 13px 13px;
  background: repeating-linear-gradient(154deg, #f0b280 0 6px, #c65a3c 6px 10px);
  box-shadow: inset 4px 0 rgba(255, 238, 210, .23), inset -5px 0 rgba(71, 21, 14, .24);
  transform: rotate(6deg) translateZ(6px);
}

.racket-cap {
  position: absolute;
  top: 366px;
  left: 81px;
  width: 40px;
  height: 12px;
  border-radius: 50%;
  background: #ef5b3e;
  box-shadow: 0 4px 0 rgba(43, 17, 11, .32);
  transform: rotate(6deg) translateZ(4px);
}

.summary-grid { gap: 14px; }
.summary-card { border: 0; border-radius: 16px; box-shadow: none; }
.summary-card:nth-child(1) { background: #ede3da; }
.summary-card:nth-child(2) { background: #bddbc9; }
.summary-card:nth-child(3) { background: #f6d6bd; }
.summary-card:nth-child(4) { background: #f8ab83; }
.summary-card:hover { box-shadow: 0 14px 32px rgba(70, 44, 29, .10); transform: translateY(-4px); }

.story-card,
.spotlight-card,
.ranking-card,
.table-card,
.matches-card,
.data-panel {
  border-color: var(--line-soft);
  border-radius: 18px;
  box-shadow: none;
}

.story-card:hover,
.spotlight-card:hover { box-shadow: 0 16px 36px rgba(70, 44, 29, .12); }
.insight-strip { border-color: transparent; background: var(--cream); border-radius: 16px; }
.section-heading { scroll-margin-top: 94px; }
.filter-chip { border-radius: 999px; }
.filter-chip.active { color: #fffaf5; background: var(--primary-action); border-color: var(--primary-action); box-shadow: none; }
.filter-chip:hover { border-color: var(--accent); }
.ranking-card,
.table-card,
.matches-card,
.data-panel { background: rgba(255, 251, 247, .72); }

.data-panel {
  background: rgba(255, 251, 247, .80);
  box-shadow: var(--shadow-small);
}

input,
textarea,
select {
  color: var(--text);
  background: rgba(255, 251, 247, .92);
  border-color: var(--line);
}

input:focus,
textarea:focus,
select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(239, 91, 62, .14); }

.primary-button,
.secondary-button,
.ghost-button { border-radius: 14px; }

.primary-button {
  color: #fffaf5;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(239, 91, 62, .24);
}

.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); box-shadow: 0 14px 30px rgba(239, 91, 62, .30); }
.secondary-button { background: var(--surface-muted); }
.secondary-button:hover { background: var(--accent-soft); border-color: rgba(239, 91, 62, .24); }
.ghost-button { color: var(--muted); border-color: var(--line); }
.ghost-button:hover { color: var(--text); background: rgba(255, 251, 247, .82); border-color: var(--accent); }

.hero-actions .primary-button {
  color: #fffaf5;
  background: #ee593c;
  border-color: #ee593c;
}

.hero-actions .ghost-button {
  color: rgba(255, 250, 245, .88);
  background: rgba(34, 23, 19, .28);
  border-color: rgba(255, 250, 245, .42);
  backdrop-filter: blur(12px);
}

.hero-actions .ghost-button:hover { color: #fffaf5; background: rgba(34, 23, 19, .48); border-color: rgba(255, 250, 245, .76); }

.source-tabs { background: var(--surface-muted); }
.source-tab.active { color: var(--text); background: var(--surface-solid); }
.analyzer-card { background: rgba(233, 223, 214, .66); }
.analyzer-stat, .field-pill { background: rgba(255, 251, 247, .66); }
.format-guide { border-color: var(--line); }

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: auto;
  bottom: 22px;
  left: 50%;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  width: min(520px, calc(100% - 44px));
  height: 70px;
  padding: 5px;
  color: rgba(255, 250, 245, .70);
  background: rgba(38, 27, 23, .92);
  border: 1px solid rgba(255, 250, 245, .20);
  border-radius: 19px;
  box-shadow: 0 18px 50px rgba(31, 18, 12, .24);
  backdrop-filter: blur(24px) saturate(130%);
  transform: translateX(-50%);
}

.nav-item {
  min-width: 0;
  color: inherit;
  border: 0;
  border-radius: 14px;
  font-weight: 600;
  transition: color 180ms var(--ease-out), background 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.nav-item + .nav-item { border-left: 1px solid rgba(255, 250, 245, .16); border-radius: 0 14px 14px 0; }
.nav-item.active, .nav-item:hover { color: #fffaf5; background: rgba(255, 250, 245, .14); }
.nav-item.active .ph { color: #ffd28d; }
.nav-item .ph { font-size: 21px; }

.cursor-ball {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  display: none;
  width: 29px;
  height: 29px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 180ms var(--ease-out), filter 180ms var(--ease-out);
}

.cursor-ball.is-visible { opacity: 1; }
.cursor-ball.is-pressed { filter: drop-shadow(0 0 0 rgba(239, 91, 62, .6)); }
.cursor-ball.is-pressed .cursor-ball-core { transform: scale(.78); }
.cursor-ball-core {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(42, 36, 15, .38);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 26%, #f9ffae 0 7%, transparent 8%), radial-gradient(circle at 66% 72%, rgba(137, 153, 30, .42), transparent 38%), #dfff3d;
  box-shadow: 0 4px 10px rgba(31, 18, 12, .28), inset -3px -4px 5px rgba(132, 148, 20, .28), inset 3px 3px 5px rgba(255, 255, 212, .62);
  transition: transform 160ms var(--ease-out);
  animation: cursor-ball-spin 1.05s linear infinite;
}

.cursor-ball-core::before,
.cursor-ball-core::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 25px;
  height: 43px;
  border: 2px solid rgba(255, 255, 235, .88);
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
}

.cursor-ball-core::before { left: -12px; transform: rotate(27deg); }
.cursor-ball-core::after { right: -12px; transform: rotate(27deg); }

@media (pointer: fine) {
  body,
  a,
  button,
  input,
  select,
  textarea { cursor: none; }

  .cursor-ball { display: block; }
}

@keyframes racket-float {
  0%, 100% { transform: perspective(760px) rotateZ(23deg) rotateY(-16deg) translate3d(0, 0, 0); }
  50% { transform: perspective(760px) rotateZ(21deg) rotateY(-9deg) translate3d(-8px, -10px, 12px); }
}

@keyframes cursor-ball-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .racket-art { right: 3%; opacity: .58; transform: perspective(760px) rotateZ(23deg) rotateY(-16deg) scale(.84); }
}

@media (max-width: 760px) {
  main { width: min(100% - 30px, 600px); }
  .topbar { height: 68px; padding: 0 15px; }
  .topbar-links { display: none; }
  .hero-section { min-height: 690px; padding: 132px 20px 172px; }
  .hero-content { max-width: 590px; }
  .hero-copy { font-size: 15px; }
  .hero-visual { padding: 22px 18px; }
  .visual-metric { bottom: 76px; left: 18px; }
  .visual-footer { right: 18px; bottom: 22px; left: 18px; }
  .racket-art { top: 18%; right: -46px; opacity: .34; transform: perspective(760px) rotateZ(23deg) rotateY(-16deg) scale(.72); }
  .bottom-nav { bottom: calc(10px + env(safe-area-inset-bottom)); width: calc(100% - 30px); }
}

@media (max-width: 440px) {
  .brand-mark { font-size: 16px; }
  .live-pill { display: none; }
  h1 { font-size: 56px; }
  h1 span::after { right: -3px; }
  .hero-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .hero-actions button { width: 100%; }
  .hero-section { min-height: 660px; }
  .racket-art { top: 20%; right: -84px; opacity: .28; }
  .nav-item > span { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .racket-art,
  .cursor-ball-core { animation: none; }
  .cursor-ball { transition: none; }
}

/* Keep the light data panel readable after the warm editorial surface override. */
.data-panel {
  color: var(--text);
}

.data-panel h2 {
  color: var(--text);
}

.data-panel .panel-copy,
.data-panel label,
.data-panel .backend-row p,
.data-panel .helper-text,
.data-panel .format-guide,
.data-panel .format-guide span,
.data-panel .analyzer-note {
  color: var(--muted);
}

.data-panel .eyebrow,
.data-panel .analyzer-kicker {
  color: var(--accent);
}

.data-panel .optional-label,
.data-panel .analyzer-stat span,
.data-panel .field-pill,
.data-panel .confidence-badge {
  color: var(--muted-2);
}

.data-panel .source-tab {
  color: var(--muted);
}

.data-panel .source-tab.active {
  color: var(--text);
}

.data-panel .format-guide strong,
.data-panel .analyzer-stat strong,
.data-panel .analyzer-header strong {
  color: var(--text);
}

.data-panel .format-guide code,
.data-panel .field-pill b {
  color: var(--accent);
}

.data-panel .backend-row p.connected,
.data-panel .status-message,
.data-panel .confidence-badge.high {
  color: var(--positive);
}

.data-panel .backend-row p.error,
.data-panel .status-message.error,
.data-panel .confidence-badge.check {
  color: var(--red);
}

.data-panel .confidence-badge.medium {
  color: var(--orange);
}

/* Final repair pass: keep the warm editorial layer stable when assets or
   JavaScript are delayed, and make the first viewport read as one system. */
.topbar {
  z-index: 50;
  visibility: visible;
  opacity: 1;
}

.topbar:not(.is-scrolled) {
  background: linear-gradient(180deg, rgba(32, 24, 21, .86), rgba(32, 24, 21, .54));
  border-bottom-color: rgba(255, 250, 245, .12);
  box-shadow: 0 8px 24px rgba(31, 18, 12, .12);
}

.topbar:not(.is-scrolled) .brand-mark,
.topbar:not(.is-scrolled) .topbar-links a,
.topbar:not(.is-scrolled) .live-pill,
.topbar:not(.is-scrolled) .icon-button {
  color: #fffaf5;
}

.topbar:not(.is-scrolled) .icon-button {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
}

.topbar:not(.is-scrolled) .icon-button:hover {
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .58);
}

.topbar.is-scrolled {
  background: rgba(243, 237, 230, .96);
  border-bottom-color: var(--line-soft);
  box-shadow: 0 8px 28px rgba(70, 44, 29, .08);
}

.hero-section {
  overflow: clip;
  isolation: isolate;
}

.hero-content {
  min-width: 0;
}

.hero-visual {
  contain: layout paint;
}

.hero-photo.image-failed,
.story-image img.image-failed,
.spotlight-image img.image-failed {
  display: none;
  visibility: hidden;
}

.hero-visual.has-image-fallback {
  background:
    radial-gradient(circle at 70% 24%, rgba(245, 175, 100, .32), transparent 26%),
    linear-gradient(145deg, #4c342a 0%, #2a1d1a 58%, #18110f 100%);
}

.hero-visual.has-image-fallback::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background:
    linear-gradient(112deg, transparent 0 45%, rgba(255, 219, 169, .13) 45.2% 45.6%, transparent 45.8%),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(255, 240, 212, .06) 43px 44px);
}

.story-image.has-image-fallback {
  background:
    radial-gradient(circle at 26% 22%, rgba(255, 230, 162, .46), transparent 11%),
    linear-gradient(135deg, #f18465 0 38%, #db4e38 38% 72%, #9d3129 72% 100%);
}

.spotlight-image.has-image-fallback {
  background:
    radial-gradient(circle at 28% 20%, rgba(216, 246, 200, .22), transparent 20%),
    linear-gradient(145deg, #2c594a, #17362f 64%, #4b6f60);
}

.story-image.has-image-fallback::before,
.spotlight-image.has-image-fallback::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  color: rgba(255, 250, 245, .76);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  transform: translate(-50%, -50%) rotate(-8deg);
}

.story-image.has-image-fallback::before { content: "MATCHDAY"; }
.spotlight-image.has-image-fallback::before { content: "SINGLES"; }

.story-image.has-image-fallback::after,
.spotlight-image.has-image-fallback::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 16%;
  border: 1px solid rgba(255, 250, 245, .30);
  border-radius: 50%;
  transform: rotate(-18deg) scaleX(.72);
}

.story-card,
.spotlight-card {
  min-height: 282px;
}

.story-copy,
.spotlight-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.story-copy .inline-link,
.spotlight-copy .inline-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 22px;
}

.summary-card,
.ranking-card,
.table-card,
.matches-card {
  min-width: 0;
}

.cursor-ball {
  will-change: transform;
}

@media (max-width: 1000px) {
  main { width: min(100% - 36px, 1160px); }
  .hero-section { gap: 42px; }
}

@media (max-width: 760px) {
  .topbar:not(.is-scrolled) {
    background: rgba(32, 24, 21, .92);
  }

  .hero-section {
    min-height: 680px;
    padding-top: 132px;
  }

  .story-card,
  .spotlight-card {
    min-height: 0;
  }

  .story-image,
  .spotlight-image {
    min-height: 176px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-ball { will-change: auto; }
}

/* Restore the hero imagery and composition without changing the lower board. */
.hero-section {
  position: relative;
  padding-top: clamp(112px, 15vh, 148px);
  padding-bottom: clamp(132px, 17vh, 164px);
}

.hero-content {
  width: min(100%, 860px);
  margin-inline: auto;
}

.hero-photo {
  filter: saturate(.88) contrast(1.04) brightness(.80);
}

.hero-photo-shade {
  background: linear-gradient(180deg, rgba(32, 20, 16, .04), rgba(32, 20, 16, .18) 34%, rgba(32, 20, 16, .62));
}

/* Never expose the browser's broken-image icon. JavaScript retries each asset
   once; the designed fallback remains visible if the retry also fails. */
.hero-photo.image-failed,
.story-image img.image-failed,
.spotlight-image img.image-failed {
  display: none;
  visibility: hidden;
  opacity: 0;
}

@media (max-width: 760px) {
  .hero-section {
    padding-top: 132px;
    padding-bottom: 172px;
  }
}

/* Secure account, admin, and player views. */
[hidden] { display: none !important; }
body.auth-loading { overflow: hidden; }
body:not(.role-player) .player-only,
body.role-player .admin-only { display: none !important; }

.auth-gate {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(360px, .92fr);
  background: var(--page);
}

.auth-visual {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: #1b261d;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 20, 12, .12), rgba(10, 20, 12, .72));
}

.auth-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.78) contrast(1.04);
}

.auth-visual-copy {
  position: absolute;
  z-index: 1;
  inset: auto clamp(28px, 5vw, 72px) clamp(36px, 7vh, 76px);
  color: #fff;
}

.auth-visual-copy .brand-mark { color: #fff; }
.auth-visual-copy p {
  max-width: 560px;
  margin: 24px 0 0;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.auth-card {
  width: min(100% - 48px, 470px);
  margin: auto;
  padding: 56px 0;
}

.auth-card h1 {
  font-size: clamp(42px, 5vw, 62px);
  line-height: 1;
}

.auth-copy {
  margin: 20px 0 30px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.auth-form { display: grid; gap: 11px; }
.auth-form label,
.invite-grid label { color: var(--muted); font-size: 12px; font-weight: 600; }
.auth-form .primary-button,
.auth-form .secondary-button { justify-content: center; margin-top: 10px; }
.bootstrap-form { margin-top: 14px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 8px 0; color: var(--muted); font-size: 12px; }
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.text-button {
  margin: 15px 18px 0 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.text-button:hover { text-decoration: underline; }
.auth-status { min-height: 22px; margin: 20px 0 0; color: var(--positive); font-size: 13px; line-height: 1.5; }
.auth-status.error,
.status-message.error { color: var(--red); }

.account-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 5px 10px 5px 6px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.account-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  color: #fff;
  background: var(--forest);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}
.account-copy { display: grid; min-width: 82px; text-align: left; }
.account-copy b { overflow: hidden; max-width: 130px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--muted); font-size: 10px; text-transform: capitalize; }

.player-dashboard { margin: 72px 0 0; }
.player-heading { margin-top: 0; }
.player-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.player-stat {
  display: grid;
  min-height: 150px;
  padding: 24px;
  align-content: space-between;
  background: var(--cream);
  border-radius: var(--radius);
}
.player-stat:nth-child(2) { background: var(--mint); }
.player-stat:nth-child(3) { background: var(--peach); }
.player-stat:nth-child(4) { background: var(--surface-muted); }
.player-stat span,
.player-stat small { color: var(--muted); font-size: 12px; }
.player-stat strong { font-size: 36px; font-weight: 400; letter-spacing: -.05em; }
.player-history-card,
.accounts-panel {
  margin-top: 18px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.player-history-card h3 { margin: 4px 0 22px; font-size: 24px; font-weight: 400; }
.player-match { display: flex; gap: 14px; padding: 15px 0; border-top: 1px solid var(--line-soft); }
.player-match div { display: grid; gap: 4px; }
.player-match strong { font-size: 14px; font-weight: 600; }
.player-match small { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.result-badge { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 800; }
.result-badge.win { color: var(--positive); background: var(--positive-soft); }
.result-badge.loss { color: var(--red); background: var(--red-soft); }
.role-pill { display: inline-flex; align-items: center; width: fit-content; padding: 6px 10px; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: capitalize; }

.accounts-panel { margin: 20px 0 120px; padding: 48px; }
.accounts-panel .panel-copy { max-width: 680px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.invite-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.invite-grid > div { display: grid; gap: 8px; }
.invite-grid .primary-button { width: fit-content; align-self: end; }
.account-list { margin-top: 26px; border-top: 1px solid var(--line); }
.account-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.account-row div { display: grid; gap: 4px; }
.account-row strong { font-size: 14px; }
.account-row small { color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .auth-gate { grid-template-columns: 1fr; }
  .auth-visual { min-height: 34vh; }
  .auth-visual-copy p { font-size: 30px; }
  .player-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .auth-card { width: min(100% - 36px, 470px); padding: 42px 0 56px; }
  .auth-visual { min-height: 300px; }
  .account-copy { display: none; }
  .account-button { padding-right: 7px; }
  .topbar-actions .live-pill { display: none; }
  .player-stat-grid,
  .invite-grid { grid-template-columns: 1fr; }
  .accounts-panel,
  .player-history-card { padding: 24px 20px; }
}

/* Login hero polish: keep the team photo, but give it a deliberate editorial
   composition and keep the light form panel readable on every viewport. */
.auth-gate {
  background:
    radial-gradient(circle at 94% 6%, rgba(239, 91, 62, .10), transparent 24rem),
    var(--page);
}

.auth-visual {
  isolation: isolate;
  background: #2d211c;
}

.auth-visual::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 207, 131, .30), transparent 25%),
    linear-gradient(112deg, rgba(18, 28, 24, .46), transparent 46%),
    linear-gradient(24deg, rgba(15, 19, 17, .34), transparent 54%);
  mix-blend-mode: screen;
}

.auth-visual::after {
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(18, 22, 19, .38), rgba(18, 22, 19, .04) 35%, rgba(18, 22, 19, .72) 100%),
    linear-gradient(90deg, rgba(18, 22, 19, .42), transparent 58%);
}

.auth-visual img {
  display: block;
  position: relative;
  z-index: 0;
  object-position: center 38%;
  filter: saturate(.90) contrast(1.06) brightness(.84);
  transform: scale(1.025);
}

.auth-visual-topline {
  position: absolute;
  z-index: 3;
  top: clamp(24px, 5vh, 56px);
  right: clamp(28px, 5vw, 72px);
  left: clamp(28px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 250, 245, .76);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: #f4f8df;
  background: rgba(28, 46, 35, .42);
  border: 1px solid rgba(255, 250, 245, .24);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  letter-spacing: .10em;
  white-space: nowrap;
}

.auth-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c8ec9c;
  box-shadow: 0 0 0 4px rgba(200, 236, 156, .14);
}

.auth-visual-copy {
  right: clamp(28px, 5vw, 72px);
  bottom: clamp(36px, 7vh, 76px);
  left: clamp(28px, 5vw, 72px);
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-visual-copy .brand-mark {
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 650;
}

.auth-visual-index {
  color: rgba(255, 250, 245, .64);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
}

.auth-visual-rule {
  display: block;
  width: min(130px, 28vw);
  height: 1px;
  margin-top: 20px;
  background: linear-gradient(90deg, #ffd36b, rgba(255, 211, 107, 0));
}

.auth-visual-copy p {
  max-width: 700px;
  margin-top: 18px;
  color: #fffaf5;
  font-size: clamp(30px, 4.1vw, 58px);
  font-weight: 450;
  line-height: 1.04;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.auth-visual-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  color: rgba(255, 250, 245, .78);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-visual-meta span {
  padding: 8px 10px;
  background: rgba(255, 250, 245, .10);
  border: 1px solid rgba(255, 250, 245, .20);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(100% - 56px, 470px);
  padding: clamp(48px, 8vh, 88px) 0;
}

.auth-card h1 {
  color: var(--text);
  font-size: clamp(46px, 5vw, 66px);
  font-weight: 520;
  line-height: .96;
  letter-spacing: -.075em;
  text-wrap: balance;
}

.auth-card .eyebrow {
  margin-bottom: 16px;
  color: var(--accent-dark);
}

.auth-copy {
  max-width: 430px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .auth-visual {
    min-height: 390px;
  }

  .auth-visual-topline {
    top: 24px;
  }

  .auth-visual-copy p {
    font-size: clamp(32px, 6vw, 48px);
  }
}

@media (max-width: 760px) {
  .auth-visual {
    min-height: 350px;
  }

  .auth-visual-topline {
    top: 22px;
    font-size: 9px;
  }

  .auth-visual-topline > span:first-child {
    max-width: 150px;
    line-height: 1.35;
  }

  .auth-visual-copy {
    bottom: 30px;
  }

  .auth-visual-copy p {
    max-width: 360px;
    margin-top: 15px;
    font-size: clamp(29px, 8.5vw, 39px);
  }

  .auth-visual-rule {
    margin-top: 15px;
  }

  .auth-visual-meta {
    margin-top: 16px;
    font-size: 8px;
  }

  .auth-visual-meta span {
    padding: 7px 8px;
  }

  .auth-card {
    width: min(100% - 40px, 470px);
    padding: 48px 0 64px;
  }

  .auth-card h1 {
    font-size: clamp(48px, 14vw, 64px);
  }
}

@media (max-width: 390px) {
  .auth-visual {
    min-height: 330px;
  }

  .auth-live {
    padding: 7px 8px;
    font-size: 8px;
  }

  .auth-visual-index {
    font-size: 9px;
  }

  .auth-visual-copy p {
    font-size: 28px;
  }
}

/* Final login direction: a single dark court world with one lime signal. */
:root {
  --auth-ink: #08151b;
  --auth-ink-elevated: #0d2028;
  --auth-text: #f3f4eb;
  --auth-muted: #a8b7b3;
  --auth-line: rgba(243, 244, 235, .16);
  --auth-lime: #d4f45c;
  --auth-blue: #246fbd;
}

body.auth-loading {
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--auth-text);
  background: var(--auth-ink);
}

.auth-gate {
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, .82fr);
  background: var(--auth-ink);
}

.auth-visual {
  min-height: 100dvh;
  isolation: isolate;
  background: var(--auth-ink-elevated);
}

.auth-visual::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  opacity: .34;
  background:
    linear-gradient(90deg, transparent 0 49.8%, rgba(212, 244, 92, .52) 49.8% 50%, transparent 50% 100%),
    repeating-linear-gradient(90deg, transparent 0 12.4%, rgba(243, 244, 235, .11) 12.4% 12.52%, transparent 12.52% 25%),
    repeating-linear-gradient(0deg, transparent 0 24.8%, rgba(243, 244, 235, .10) 24.8% 25%, transparent 25% 50%);
  mix-blend-mode: screen;
  mask-image: linear-gradient(115deg, transparent 0 18%, black 44%, transparent 95%);
}

.auth-visual::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 21, 27, .76), rgba(8, 21, 27, .18) 48%, rgba(8, 21, 27, .62)),
    linear-gradient(0deg, rgba(8, 21, 27, .78), transparent 55%, rgba(8, 21, 27, .24));
}

.auth-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 41%;
  filter: saturate(.72) contrast(1.14) brightness(.76) sepia(.04);
  transform: scale(1.045);
  transition: transform 1200ms var(--ease-out);
}

.auth-visual-topline {
  top: 28px;
  right: clamp(28px, 5vw, 72px);
  left: clamp(28px, 5vw, 72px);
  z-index: 5;
  color: rgba(243, 244, 235, .72);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.auth-live {
  gap: 8px;
  padding: 0;
  color: var(--auth-lime);
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  letter-spacing: .10em;
}

.auth-live-dot {
  background: var(--auth-lime);
  box-shadow: 0 0 0 4px rgba(212, 244, 92, .14);
}

.auth-visual-copy {
  right: clamp(28px, 5vw, 72px);
  bottom: clamp(42px, 8vh, 88px);
  left: clamp(28px, 5vw, 72px);
  z-index: 5;
}

.auth-visual-copy .brand-mark {
  color: var(--auth-text);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 650;
  letter-spacing: -.06em;
}

.auth-visual-copy .brand-dot {
  background: var(--auth-lime);
  box-shadow: 0 0 0 4px rgba(212, 244, 92, .14);
}

.auth-visual-copy .brand-ai {
  color: var(--auth-lime);
}

.auth-visual-index {
  color: rgba(243, 244, 235, .62);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-visual-rule {
  width: min(230px, 42vw);
  height: 2px;
  margin-top: 24px;
  background: linear-gradient(90deg, var(--auth-lime), rgba(212, 244, 92, 0));
}

.auth-visual-copy p {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--auth-text);
  font-family: "Arial Narrow", "Avenir Next Condensed", "Segoe UI", sans-serif;
  font-size: clamp(42px, 6.4vw, 88px);
  font-weight: 750;
  line-height: .90;
  letter-spacing: -.075em;
  text-wrap: balance;
}

.auth-visual-copy p span {
  color: var(--auth-lime);
}

.auth-visual-meta {
  gap: 0;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--auth-line);
  color: rgba(243, 244, 235, .76);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.auth-visual-meta span {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
}

.auth-visual-meta span + span::before {
  content: "/";
  display: inline-block;
  margin: 0 14px;
  color: var(--auth-lime);
}

.auth-visual-court {
  position: absolute;
  z-index: 4;
  top: 19%;
  right: -7%;
  width: min(44vw, 700px);
  aspect-ratio: 1.62;
  border: 1px solid rgba(243, 244, 235, .36);
  opacity: .52;
  transform: perspective(720px) rotateX(55deg) rotateZ(-12deg);
  pointer-events: none;
}

.auth-visual-court::before,
.auth-visual-court::after {
  content: "";
  position: absolute;
  background: rgba(243, 244, 235, .42);
}

.auth-visual-court::before {
  top: 25%;
  right: 10%;
  left: 10%;
  height: 1px;
}

.auth-visual-court::after {
  top: 10%;
  bottom: 10%;
  left: 50%;
  width: 1px;
}

.auth-visual-court span {
  position: absolute;
  top: 25%;
  bottom: 25%;
  width: 25%;
  border: 1px solid rgba(243, 244, 235, .32);
}

.auth-visual-court span:nth-child(1) { left: 10%; border-left: 0; }
.auth-visual-court span:nth-child(2) { right: 10%; border-right: 0; }
.auth-visual-court span:nth-child(3) { inset: 10% 10%; border-top: 0; border-bottom: 0; opacity: .52; }

.auth-card {
  position: relative;
  width: min(100% - 72px, 470px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(42px, 8vh, 92px) 0;
  color: var(--auth-text);
  background: var(--auth-ink);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: -4vw;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(212, 244, 92, .34) 22%, rgba(212, 244, 92, .08) 82%, transparent);
  pointer-events: none;
}

.auth-card::after {
  content: "";
  position: absolute;
  top: clamp(42px, 8vh, 92px);
  right: -72px;
  left: -72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--auth-line), transparent);
  pointer-events: none;
}

.auth-card-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: clamp(62px, 10vh, 120px);
  color: rgba(243, 244, 235, .62);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.auth-card-topline span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--auth-lime);
}

.auth-card-topline .ph {
  font-size: 14px;
}

.auth-card > *:not(.auth-card-topline) {
  position: relative;
  z-index: 1;
}

.auth-card .eyebrow {
  margin-bottom: 17px;
  color: var(--auth-lime);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.auth-card h1 {
  max-width: none;
  color: var(--auth-text);
  font-family: "Arial Narrow", "Avenir Next Condensed", "Segoe UI", sans-serif;
  font-size: clamp(54px, 6vw, 78px);
  font-weight: 750;
  line-height: .88;
  letter-spacing: -.08em;
}

.auth-copy {
  max-width: 390px;
  margin: 24px 0 32px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.65;
}

.auth-form label,
.invite-grid label {
  color: rgba(243, 244, 235, .82);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}

.auth-form input {
  min-height: 50px;
  color: var(--auth-text);
  background: var(--auth-ink-elevated);
  border-color: var(--auth-line);
  border-radius: 7px;
}

.auth-form input::placeholder {
  color: rgba(168, 183, 179, .58);
}

.auth-form input:focus {
  background: #102a33;
  border-color: var(--auth-lime);
  box-shadow: 0 0 0 4px rgba(212, 244, 92, .12);
}

.auth-card .primary-button,
.auth-card .secondary-button {
  min-height: 50px;
  border-radius: 7px;
  font-size: 12px;
  letter-spacing: .01em;
}

.auth-card .primary-button {
  color: var(--auth-ink);
  background: var(--auth-lime);
  border-color: var(--auth-lime);
  box-shadow: 0 12px 28px rgba(212, 244, 92, .10);
}

.auth-card .secondary-button {
  color: var(--auth-lime);
  background: transparent;
  border: 1px solid rgba(212, 244, 92, .52);
}

.auth-card .text-button {
  color: rgba(243, 244, 235, .70);
}

.auth-card .text-button:hover {
  color: var(--auth-lime);
}

.auth-divider {
  color: rgba(243, 244, 235, .50);
}

.auth-divider::before,
.auth-divider::after {
  background: var(--auth-line);
}

.auth-status {
  color: var(--auth-lime);
}

.auth-status.error {
  color: #ff9b8f;
}

.auth-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 34px 0 0;
  color: rgba(168, 183, 179, .66);
  font-size: 11px;
  line-height: 1.5;
}

.auth-footnote .ph {
  color: var(--auth-lime);
  font-size: 16px;
}

@media (hover: hover) and (pointer: fine) {
  .auth-visual:hover img {
    transform: scale(1.065);
  }

  .auth-card .primary-button:hover {
    color: var(--auth-ink);
    background: #e1ff70;
    border-color: #e1ff70;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(212, 244, 92, .18);
  }

  .auth-card .secondary-button:hover {
    color: var(--auth-text);
    background: rgba(212, 244, 92, .08);
    border-color: var(--auth-lime);
    transform: translateY(-2px);
  }
}

.auth-card .primary-button:active,
.auth-card .secondary-button:active,
.auth-card .text-button:active {
  transform: scale(.98);
}

@media (max-width: 900px) {
  .auth-gate {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 56svh) auto;
  }

  .auth-visual {
    min-height: 56svh;
    max-height: 680px;
  }

  .auth-card {
    width: min(100% - 48px, 520px);
    min-height: auto;
    padding: 54px 0 72px;
  }

  .auth-card::before {
    top: 0;
    right: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 244, 92, .34), transparent);
  }

  .auth-card::after {
    display: none;
  }

  .auth-card-topline {
    margin-bottom: 56px;
  }

  .auth-visual-court {
    top: 16%;
    right: -16%;
    width: 520px;
  }
}

@media (max-width: 760px) {
  .auth-gate {
    grid-template-rows: minmax(340px, 52svh) auto;
  }

  .auth-visual {
    min-height: 52svh;
  }

  .auth-visual-topline {
    top: 22px;
    font-size: 9px;
  }

  .auth-visual-copy {
    bottom: 32px;
  }

  .auth-visual-copy p {
    max-width: 390px;
    margin-top: 17px;
    font-size: clamp(38px, 10vw, 58px);
  }

  .auth-visual-meta {
    margin-top: 20px;
    font-size: 8px;
  }

  .auth-visual-meta span + span::before {
    margin: 0 8px;
  }

  .auth-card {
    width: min(100% - 36px, 520px);
    padding: 44px 0 68px;
  }

  .auth-card-topline {
    margin-bottom: 50px;
  }

  .auth-card h1 {
    font-size: clamp(54px, 15vw, 74px);
  }
}

@media (max-width: 390px) {
  .auth-visual {
    min-height: 48svh;
  }

  .auth-visual-topline > span:first-child {
    max-width: 145px;
    line-height: 1.35;
  }

  .auth-visual-index {
    font-size: 8px;
  }

  .auth-visual-copy p {
    font-size: 36px;
  }

  .auth-visual-meta {
    gap: 4px;
    letter-spacing: .06em;
  }

  .auth-visual-meta span + span::before {
    margin: 0 5px;
  }

  .auth-card {
    width: min(100% - 30px, 520px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-visual img,
  .auth-visual:hover img {
    transform: none;
    transition: none;
  }
}
