@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;800;900&family=Roboto+Mono:wght@500;600&display=swap');

:root {
  --navy: #071a33;
  --navy-2: #0c284a;
  --red: #e53a46;
  --lime: #d8ff3e;
  --paper: #f5f2ea;
  --ink: #0b1728;
  --muted: #697483;
  --line: #d6d5cf;
  --white: #fffef9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.mobile-recommendation {
  min-height: 48px;
  padding: 10px clamp(22px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--lime);
  color: var(--navy);
  border-bottom: 3px solid var(--red);
  text-align: center;
  font-size: 13px;
}
.mobile-recommendation strong { font-size: 16px; font-weight: 900; letter-spacing: .02em; }
.mobile-recommendation-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 30px;
  border: 3px solid currentColor;
  border-radius: 5px;
  font-size: 0;
}
.mobile-recommendation-icon::after { content: ''; width: 5px; height: 3px; border-radius: 3px; background: currentColor; align-self: end; margin-bottom: 2px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.masthead {
  height: 76px;
  padding: 0 clamp(22px, 5vw, 76px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  background: var(--navy);
  color: white;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: .08em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--navy);
  background: var(--lime);
  border-radius: 50% 50% 45% 55%;
  font: 700 13px 'Roboto Mono', monospace;
  transform: rotate(-8deg);
}
.brand-mark::first-line { transform: rotate(8deg); }
nav { display: flex; gap: clamp(20px, 4vw, 48px); font-size: 13px; font-weight: 600; }
nav a { padding: 28px 0 25px; border-bottom: 3px solid transparent; opacity: .76; }
nav a:hover, nav a:focus-visible { opacity: 1; border-color: var(--lime); }
.refresh-button {
  justify-self: end;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  padding: 9px 15px;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.refresh-button:hover { background: white; color: var(--navy); }
.refresh-button:disabled { opacity: .55; cursor: wait; }
.refresh-icon { display: inline-block; margin-right: 5px; font-size: 16px; }
.is-loading .refresh-icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero {
  min-height: 480px;
  padding: 64px clamp(22px, 7vw, 106px) 58px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  align-items: center;
  gap: clamp(50px, 8vw, 130px);
  background:
    radial-gradient(circle at 9% 26%, rgba(216,255,62,.13) 0 2px, transparent 3px),
    linear-gradient(120deg, var(--navy) 0 62%, var(--navy-2) 62%);
  background-size: 18px 18px, auto;
  color: white;
  overflow: hidden;
}
.eyebrow { display: flex; align-items: center; gap: 10px; font: 600 12px 'Roboto Mono', monospace; letter-spacing: .16em; color: #cbd4df; }
.eyebrow span { width: 34px; height: 3px; background: var(--lime); }
h1 { margin: 22px 0 22px; font-size: clamp(52px, 6.4vw, 92px); line-height: .97; letter-spacing: -.06em; font-weight: 900; }
h1 em { color: var(--lime); font-style: normal; }
.hero-deck { max-width: 520px; margin: 0; color: #cbd4df; font-size: 17px; line-height: 1.8; }
.data-status { display: inline-flex; align-items: center; gap: 9px; margin-top: 28px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: #e7ebf0; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(216,255,62,.12); }
.data-status[data-mode='fallback'] .status-dot { background: #ffbd2e; box-shadow: 0 0 0 4px rgba(255,189,46,.12); }
.data-status[data-mode='error'] .status-dot { background: var(--red); }

.next-card {
  position: relative;
  background: var(--white);
  color: var(--ink);
  padding: 0;
  box-shadow: 18px 18px 0 var(--red);
}
.next-card::before { content: ''; position: absolute; top: -16px; right: 26px; width: 78px; height: 16px; background: var(--lime); }
.next-card-topline { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 57px; padding: 10px 14px 10px 22px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.timezone { color: var(--muted); }
.feature-navigation { display: flex; align-items: center; gap: 7px; }
.feature-arrow { position: absolute; top: 55%; z-index: 3; width: 62px; height: 62px; display: grid; place-items: center; border: 4px solid white; border-radius: 50%; background: var(--red); color: white; box-shadow: 0 8px 22px rgba(9, 26, 44, .28); cursor: pointer; font: 700 48px/1 Arial, sans-serif; transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease; }
.feature-arrow-prev { left: -76px; transform: translateY(-50%); padding: 0 4px 5px 0; }
.feature-arrow-next { right: -76px; transform: translateY(-50%); padding: 0 0 5px 4px; }
.feature-arrow:hover:not(:disabled) { background: var(--lime); color: var(--ink); box-shadow: 0 11px 28px rgba(9, 26, 44, .36); }
.feature-arrow-prev:hover:not(:disabled), .feature-arrow-next:hover:not(:disabled) { transform: translateY(-50%) scale(1.08); }
.feature-arrow:focus-visible { outline: 4px solid var(--lime); outline-offset: 3px; }
.feature-arrow:disabled { opacity: .28; cursor: default; }
.feature-content { min-height: 245px; padding: 26px 24px 24px; animation: feature-in .22s ease-out; }
@keyframes feature-in { from { opacity: .25; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
.feature-meta { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 12px; }
.feature-players { margin: 24px 0 20px; display: grid; gap: 11px; }
.feature-player { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: clamp(21px, 2.1vw, 30px); font-weight: 900; }
.feature-player small { color: var(--muted); font: 600 11px 'Roboto Mono', monospace; }
.feature-versus { color: var(--red); font: 800 11px 'Roboto Mono', monospace; letter-spacing: .12em; }
.feature-footer { display: flex; justify-content: space-between; align-items: end; padding-top: 18px; border-top: 3px solid var(--ink); }
.feature-time { font-size: 25px; font-weight: 900; }
.feature-time small { display: block; color: var(--muted); font: 500 10px 'Roboto Mono', monospace; letter-spacing: .08em; }
.feature-time .timing-context { margin-top: 5px; color: #526218; font-weight: 700; letter-spacing: 0; }
.court-pill { padding: 6px 9px; border-radius: 3px; background: var(--lime); font-size: 11px; font-weight: 800; }
.pending-text { color: #9ca3ad !important; font-style: italic; font-weight: 500 !important; opacity: .72; }
.court-pill:has(.pending-text) { background: #eceef0; }
.loading-copy { min-height: 205px; display: grid; place-items: center; margin: 0; color: var(--muted); }

.scoreboard {
  margin: -1px auto 0;
  padding: 0 clamp(22px, 5vw, 76px);
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr)) minmax(230px, 1.5fr);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.scoreboard article { padding: 26px 20px; display: flex; align-items: baseline; gap: 9px; border-right: 1px solid var(--line); }
.metric-number { font: 700 34px 'Roboto Mono', monospace; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.live-number { color: var(--red); }
.scoreboard-note { align-self: center; justify-self: end; display: grid; text-align: right; gap: 4px; color: var(--muted); font: 500 10px 'Roboto Mono', monospace; }

.content-section { padding: 82px clamp(22px, 7vw, 106px); scroll-margin-top: 30px; }
.completed-section { background: var(--white); }
.players-section { background: #e8e5dc; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 34px; }
.section-heading > div { display: flex; align-items: center; gap: 18px; }
.section-index { color: var(--red); font: 700 12px 'Roboto Mono', monospace; }
h2 { margin: 0; font-size: clamp(28px, 3.3vw, 46px); letter-spacing: -.04em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }

.match-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.match-card { position: relative; min-height: 260px; padding: 22px; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); transition: transform .18s, box-shadow .18s; }
.match-card:hover { transform: translateY(-4px); box-shadow: 0 14px 35px rgba(7,26,51,.08); }
.match-card.is-live { border-top: 5px solid var(--red); }
.match-card-meta { display: flex; justify-content: space-between; color: var(--muted); font: 500 10px 'Roboto Mono', monospace; }
.match-status { color: var(--red); font-weight: 700; }
.match-status.upcoming { color: #526218; }
.match-players { display: grid; gap: 12px; margin: 31px 0 auto; }
.match-player { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: 19px; font-weight: 800; }
.match-player .country { display: block; color: var(--muted); font: 500 10px 'Roboto Mono', monospace; }
.match-player.china .country { color: var(--red); font-weight: 700; }
.match-score { font: 700 19px 'Roboto Mono', monospace; }
.match-card-footer { margin-top: 23px; padding-top: 16px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.match-card-footer > span:first-child { display: grid; gap: 4px; }
.match-card-footer small { color: #526218; font-size: 10px; font-weight: 700; }

.results-list { border-top: 3px solid var(--ink); }
.result-row { display: grid; grid-template-columns: 135px minmax(210px, 1fr) minmax(210px, 1fr) 110px 42px; align-items: center; gap: 20px; padding: 22px 8px; border-bottom: 1px solid var(--line); }
.result-meta { color: var(--muted); font: 500 10px/1.7 'Roboto Mono', monospace; }
.result-player { font-size: 16px; font-weight: 800; }
.result-player small { display: block; color: var(--muted); font: 500 10px 'Roboto Mono', monospace; }
.result-score { text-align: right; font: 700 14px 'Roboto Mono', monospace; }
.result-outcome { justify-self: end; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-weight: 900; }
.result-outcome.win { background: var(--red); }
.search-box { width: min(260px, 42vw); padding: 8px 12px; display: flex; align-items: center; border-bottom: 2px solid var(--ink); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; }

.player-list { display: flex; flex-wrap: wrap; gap: 10px; }
.player-chip { border: 1px solid #bcbab2; padding: 11px 16px; background: var(--paper); cursor: pointer; font-weight: 700; }
.player-chip:hover, .player-chip.active { background: var(--navy); color: white; border-color: var(--navy); }
.player-chip small { margin-left: 8px; color: var(--muted); font: 500 9px 'Roboto Mono', monospace; }
.player-chip.active small, .player-chip:hover small { color: #bdc7d3; }

.empty-state { grid-column: 1 / -1; padding: 56px 24px; text-align: center; border: 1px dashed #b8b8b2; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 18px; }
.source-note { padding: 56px clamp(22px, 7vw, 106px); display: grid; grid-template-columns: .7fr 1.6fr auto; gap: 50px; align-items: center; background: var(--lime); }
.source-note h2 { font-size: 30px; }
.source-kicker { font: 700 10px 'Roboto Mono', monospace; }
.source-note p { margin: 0; max-width: 760px; line-height: 1.8; font-size: 13px; }
.source-note a { padding-bottom: 4px; border-bottom: 2px solid var(--ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
footer { padding: 28px clamp(22px, 5vw, 76px); display: flex; justify-content: space-between; background: var(--navy); color: #aebaca; font: 500 10px 'Roboto Mono', monospace; }

@media (max-width: 900px) {
  .masthead { grid-template-columns: 1fr auto; }
  nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 48px; }
  .next-card { max-width: 600px; }
  .scoreboard { grid-template-columns: repeat(2, 1fr); }
  .scoreboard-note { grid-column: 1 / -1; justify-self: stretch; padding: 18px 0; text-align: left; }
  .match-grid { grid-template-columns: repeat(2, 1fr); }
  .result-row { grid-template-columns: 95px 1fr 1fr 90px 40px; gap: 13px; }
  .source-note { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 620px) {
  .mobile-recommendation { padding: 9px 15px; gap: 9px; }
  .mobile-recommendation strong { font-size: 15px; }
  .mobile-recommendation > span:last-child { display: none; }
  .masthead { height: 68px; padding-inline: 17px; }
  .brand { font-size: 12px; }
  .refresh-button { padding: 8px 10px; }
  .hero { padding: 44px 18px 52px; gap: 42px; }
  h1 { font-size: 50px; }
  .next-card { margin-bottom: 74px; box-shadow: 9px 9px 0 var(--red); }
  .next-card-topline { align-items: flex-start; padding-left: 16px; }
  .feature-navigation { justify-content: flex-end; }
  .timezone { text-align: right; font-size: 9px; }
  .feature-arrow { top: auto; bottom: -68px; width: 54px; height: 54px; border-width: 3px; font-size: 42px; transform: none; }
  .feature-arrow-prev { left: calc(50% - 61px); }
  .feature-arrow-next { right: calc(50% - 61px); }
  .feature-arrow-prev:hover:not(:disabled), .feature-arrow-next:hover:not(:disabled) { transform: scale(1.08); }
  .scoreboard { padding-inline: 18px; }
  .scoreboard article { padding: 20px 10px; }
  .metric-number { font-size: 28px; }
  .content-section { padding: 60px 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .match-grid { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: 72px 1fr 42px; gap: 12px; }
  .result-row .result-player:nth-of-type(3) { grid-column: 2; }
  .result-score { grid-column: 2; text-align: left; }
  .result-outcome { grid-row: 1 / span 3; grid-column: 3; }
  .search-box { width: 100%; }
  footer { gap: 15px; flex-direction: column; }
}

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