/* =====================================================
   YepTennis — Option 3
   Grand Slam focused / editorial tennis design
   ===================================================== */

:root {
  --ink: #06150e;          /* header, dark badges */
  --text: #eaf5ef;         /* main text on the green background */
  --text-dim: #c3d6cc;
  --surface: #12301f;      /* cards */
  --surface-2: #173a28;    /* bands, chips, hovers */
  --ink-2: #0d2028;
  --green: #20df86;
  --green-dark: #3fe39a;   /* readable green on dark */
  --paper: #0c2318;        /* page background: deep green */
  --white: #fff;
  --muted: #9bb5a8;
  --line: #26493a;
  --red: #c85745;
  --clay: #a95b40;
  --blue: #416a91;
  --radius: 12px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
}

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


/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--ink);
  color: white;
  box-shadow: 0 4px 22px rgba(0,0,0,.18);
}

.header-inner {
  max-width: 1260px;
  height: 68px;
  margin: auto;
  padding: 0 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 21px;
  font-weight: 950;
  letter-spacing: -.8px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--green);
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
}

.brand > span:last-child > span,
.footer-brand span {
  color: var(--green);
}

.desktop-nav {
  display: flex;
  gap: 27px;
}

.desktop-nav a {
  position: relative;
  padding: 25px 0;
  color: #b9c6c9;
  font-size: 11px;
  font-weight: 800;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: white;
}

.desktop-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  height: 2px;
  background: var(--green);
}

.menu {
  display: none;
  min-width: 44px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  border: 0;
  background: transparent;
  color: white;
  font-size: 25px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
}

.mobile-nav.open {
  display: flex;
  flex-direction: column;
  padding: 4px 22px 15px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.mobile-nav a {
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}


/* HERO */

.hero {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  color: white;
  background: var(--ink);
}

.hero-photo {
  position: absolute;
  inset: 0;
  background:
    url("https://images.unsplash.com/photo-1554068865-24cecd4e34b8?auto=format&fit=crop&w=2200&q=90")
    center 42% / cover no-repeat;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3,14,19,.97) 0%, rgba(3,14,19,.86) 39%, rgba(3,14,19,.25) 78%),
    linear-gradient(0deg, rgba(3,14,19,.62), transparent 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1260px;
  margin: auto;
  padding: 115px 25px;
}

.hero-kicker {
  margin-bottom: 15px;
  color: var(--green);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 2.5px;
}

.hero h1 {
  margin: 0;
  max-width: 700px;
  font-size: clamp(52px, 7vw, 88px);
  line-height: .91;
  letter-spacing: -4px;
}

.hero h1 em {
  color: var(--green);
  font-style: normal;
}

.hero p {
  max-width: 500px;
  margin: 26px 0 30px;
  color: #d2dcde;
  font-size: 16px;
}

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

.primary-btn,
.outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 19px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.primary-btn {
  background: var(--green);
  color: var(--ink);
}

.outline-btn {
  border: 1px solid rgba(255,255,255,.5);
  color: white;
}

.hero-season {
  position: absolute;
  z-index: 3;
  right: 26px;
  bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #c7d1d3;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
}

.hero-season strong {
  color: var(--green);
  font-size: 22px;
}


/* COMMON SECTIONS */

.section {
  max-width: 1260px;
  margin: auto;
  padding: 72px 25px;
}

.section-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 27px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 2px;
}

.section-intro h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -1.6px;
}

.section-intro > p {
  margin: 0;
  max-width: 300px;
  color: var(--muted);
  font-size: 11px;
}

.text-link {
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 950;
}

.news-source {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}


/* GRAND SLAMS */

.slam-feature {
  padding-top: 70px;
  padding-bottom: 80px;
}

.slam-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.slam-feature-card {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  border-radius: 10px;
  color: white;
  background: #12232a;
  box-shadow: 0 13px 35px rgba(4,18,23,.12);
  isolation: isolate;
}

.slam-feature-card::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background-position: center;
  background-size: cover;
  transition: transform .45s ease;
}

.slam-feature-card:hover::before {
  transform: scale(1.06);
}

.slam-feature-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(0deg, rgba(3,12,16,.94), rgba(3,12,16,.12) 70%);
}

.australian::before {
  background-image: url("https://images.unsplash.com/photo-1595435934249-5df7ed86e1c0?auto=format&fit=crop&w=1100&q=85");
}

.roland::before {
  background-image: url("https://images.unsplash.com/photo-1560012057-4372e14c5085?auto=format&fit=crop&w=1100&q=85");
}

.wimbledon::before {
  background-image: url("https://images.unsplash.com/photo-1622279457486-62dcc4a431d6?auto=format&fit=crop&w=1100&q=85");
}

.usopen::before {
  background-image: url("https://images.unsplash.com/photo-1554068865-24cecd4e34b8?auto=format&fit=crop&w=1100&q=85");
}

.slam-number {
  position: absolute;
  top: 20px;
  left: 22px;
  color: rgba(255,255,255,.65);
  font-size: 10px;
  font-weight: 900;
}

.slam-info {
  position: relative;
  width: 100%;
}

.slam-info > span {
  display: block;
  margin-bottom: 7px;
  color: var(--green);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 1.4px;
}

.slam-info h3 {
  margin: 0;
  font-size: clamp(28px, 3vw, 43px);
  line-height: .94;
  letter-spacing: -1.5px;
}

.slam-info b {
  position: absolute;
  right: 0;
  bottom: 0;
  color: rgba(255,255,255,.82);
  font-size: 30px;
}


/* TOUR BAR */

.tour-bar {
  background: var(--ink);
  color: white;
}

.tour-bar-inner {
  max-width: 1260px;
  min-height: 120px;
  margin: auto;
  padding: 22px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tour-title span {
  color: var(--green);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 2px;
}

.tour-title h2 {
  margin: 3px 0 0;
  font-size: 29px;
  letter-spacing: -1px;
}

.tour-links {
  display: flex;
}

.tour-links a {
  min-width: 140px;
  padding: 13px 20px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #20373e;
}

.tour-links strong {
  color: white;
  font-size: 16px;
}

.tour-links small {
  color: #7e9399;
  font-size: 9px;
}


/* RESULTS */

.results-section {
  padding-top: 68px;
}

.api-date {
  color: var(--muted);
  font-size: 10px;
}

.results-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 9px 26px rgba(5,19,24,.07);
}

.tabs {
  min-height: 55px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  padding: 8px 13px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 950;
}

.tabs button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tabs button.selected {
  background: var(--ink);
  color: var(--green);
}

#results-list {
  min-height: 110px;
}

.match {
  display: grid;
  grid-template-columns: minmax(250px,1fr) 150px 90px;
  align-items: center;
  gap: 20px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.match:last-child {
  border-bottom: 0;
}

.match > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match b {
  font-size: 12px;
}

.tournament-name {
  color: var(--muted);
  font-size: 9px;
}

.scores {
  display: flex;
  justify-content: center;
  gap: 25px;
  font-size: 12px;
}

.match-status,
.live-status {
  text-align: right;
  color: var(--muted);
  font-size: 8px;
  font-weight: 950;
  text-transform: uppercase;
}

.live-status {
  color: var(--green-dark);
}

.loading,
.empty-state,
.error-state {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}


/* ATP / WTA PANELS */

.tour-panel {
  padding-top: 58px;
  padding-bottom: 58px;
}

.wta-panel {
  background: var(--surface-2);
  max-width: none;
  padding-left: max(25px, calc((100% - 1210px) / 2));
  padding-right: max(25px, calc((100% - 1210px) / 2));
}

.tour-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 11px;
}

.tour-grid a {
  min-height: 145px;
  padding: 19px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  transition: transform .2s ease, border-color .2s ease;
}

.tour-grid a:hover {
  transform: translateY(-3px);
  border-color: var(--green);
}

.tour-grid span {
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 1.5px;
}

.tour-grid strong {
  margin-top: 16px;
  font-size: 18px;
}

.tour-grid small {
  color: var(--muted);
  font-size: 10px;
}


/* SERIES */

.series-section {
  padding-top: 55px;
}

.series-block {
  padding: 42px 0;
  border-top: 1px solid var(--line);
}

.series-block > div:first-child {
  margin-bottom: 20px;
}

.series-block h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -1px;
}

.series-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.series-cards article {
  padding: 22px;
  border-radius: 9px;
  background: var(--ink);
  color: white;
}

.series-cards span {
  color: var(--green);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 1.4px;
}

.series-cards h3 {
  margin: 9px 0 4px;
  font-size: 19px;
}

.series-cards p {
  margin: 0;
  color: #8da0a6;
  font-size: 10px;
}


/* NEWS */

.news-title{
  margin-top:28px;
}

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

.news-list article{
  display:flex;
  align-items:flex-start;
  gap:12px;
  background: var(--surface);
  padding:8px;
  border-radius:7px;
  border:1px solid var(--line);
  min-height:90px;
}

.news-img{
  width:160px;
  min-width:160px;
  flex:0 0 160px;
  aspect-ratio:16 / 9;
  height:auto;
  object-fit:cover;
  object-position:center;
  border-radius:6px;
  background: var(--surface-2);
  display:block;
}

.news-list article > div:last-child{
  padding:2px 4px 2px 0;
}

.news-list b{
  font-size:13px;
  line-height:1.35;
  display:block;
}

.news-list span{
  font-size:11px;
  color:#7b858c;
  display:block;
  margin-top:7px;
}

/* FOOTER */

.site-footer {
  background: var(--ink);
  color: white;
}

.footer-inner {
  max-width: 1260px;
  margin: auto;
  padding: 30px 25px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 30px;
  align-items: center;
}

.footer-brand {
  font-size: 18px;
  font-weight: 950;
}

.footer-inner p {
  margin: 4px 0 0;
  color: #71848a;
  font-size: 9px;
}

.footer-nav {
  display: flex;
  gap: 19px;
}

.footer-nav a {
  color: #a7b5b9;
  font-size: 9px;
  font-weight: 800;
}

.footer-inner small {
  color: #71848a;
  font-size: 9px;
}


/* TABLET */

@media (max-width: 1000px) {
  .slam-feature-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .news-list {
    grid-template-columns: 1fr 1fr;
  }
}


/* MOBILE */

@media (max-width: 720px) {
  .header-inner {
    height: 62px;
    padding: 0 17px;
  }

  .desktop-nav { display: none; }
  .menu { display: block; }

  .hero {
    min-height: 510px;
  }

  .hero-content {
    padding: 82px 18px;
  }

  .hero h1 {
    font-size: 52px;
    letter-spacing: -2.5px;
  }

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

  .hero-season {
    right: 18px;
    bottom: 18px;
  }

  .section {
    padding: 52px 17px;
  }

  .section-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .section-intro h2 {
    font-size: 31px;
  }

  .slam-feature-grid,
  .tour-grid,
  .series-cards,
  .news-list {
    grid-template-columns: 1fr;
  }

  .slam-feature-card {
    min-height: 245px;
  }

  .tour-bar-inner {
    min-height: 100px;
    padding: 20px 17px;
  }

  .tour-links a {
    min-width: 100px;
    padding: 10px 12px;
  }

  .match {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .scores {
    grid-column: 2;
    grid-row: 1;
  }

  .match-status,
  .live-status {
    grid-column: 1 / -1;
    text-align: left;
  }

  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar { display: none; }

  .api-date { display: none; }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: 43px;
  }

  .hero p {
    font-size: 14px;
  }

  .tour-links a {
    min-width: 85px;
  }
}

/* =========================================================
   RANKINGS
   ========================================================= */

.ranking-item {
  display: grid;
  grid-template-columns: 40px 1fr 70px 26px;
  align-items: center;
  gap: 15px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.ranking-info {
  text-decoration: none;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.ranking-info:hover {
  color: var(--text);
}

.ranking-item:last-child {
  border-bottom: 0;
}

.ranking-rank {
  font-weight: 950;
  color: var(--muted);
}

.ranking-name {
  font-weight: 800;
  color: var(--text);
}

.ranking-points {
  text-align: right;
  color: var(--muted);
  font-size: 11px;
}

/* =========================================================
   CALENDAR
   ========================================================= */

.calendar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.calendar-badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.calendar-badge.cat-grand-slam {
  background: var(--ink);
  color: var(--green);
}

.calendar-item:last-child {
  border-bottom: 0;
}

.calendar-item b {
  font-size: 13px;
  display: block;
}

.calendar-item span {
  font-size: 11px;
  color: var(--muted);
}

.calendar-item small {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

/* =========================================================
   DATE NAV (browse results day by day)
   ========================================================= */

.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.date-nav button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
}

.date-nav button:hover:not(:disabled) {
  background: var(--ink);
  color: var(--green);
}

.date-nav button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.date-nav span {
  font-size: 12px;
  font-weight: 950;
  color: var(--text);
  min-width: 160px;
  text-align: center;
}

/* =========================================================
   DAY CHIPS, RANKING BIOS
   ========================================================= */

.day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.day-chips button {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.day-chips button.selected {
  background: var(--ink);
  color: var(--green);
  border-color: var(--text);
}

.ranking-name b {
  display: block;
}

.ranking-bio {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.news-item p {
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* winner / loser lines on finished matches */
.match-players b.winner { color: var(--text); }
.match-players b.loser  { color: var(--muted); font-weight: 600; }

/* smaller rectangular news images on phones */
@media (max-width: 480px) {
  .news-img {
    width: 120px;
    min-width: 120px;
    flex: 0 0 120px;
  }
}


/* FOOTER: legal links + contact */
.footer-legal {
  max-width: 1260px;
  margin: auto;
  padding: 16px 25px calc(22px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.footer-legal a {
  color: #a7b5b9;
  font-size: 12px;
  font-weight: 600;
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--green);
}

/* ABOUT / TERMS PAGES */
.page-header {
  background: var(--ink);
  color: white;
}

.page-header .header-inner a.back-link {
  color: #a7b5b9;
  font-size: 13px;
  font-weight: 700;
}

.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 22px 64px;
  color: var(--text);
}

.legal-page h1 {
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1.1;
  margin: 0 0 8px;
}

.legal-page .updated {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 32px;
}

.legal-page h2 {
  font-size: 19px;
  margin: 34px 0 10px;
}

.legal-page p,
.legal-page li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-dim);
}

.legal-page ul {
  padding-left: 20px;
}

.legal-page a {
  color: var(--green-dark);
  text-decoration: underline;
}


/* =========================================================
   RESULTS: readable sizes and cleaner layout (v12)
   ========================================================= */

.api-date { font-size: 13px; }

.date-nav { padding: 12px 16px; gap: 20px; }
.date-nav button { width: 38px; height: 38px; font-size: 15px; }
.date-nav span { font-size: 16px; }

.day-chips { padding: 12px 16px; gap: 8px; }
.day-chips button { padding: 8px 16px; font-size: 13px; font-weight: 800; }

.tabs { min-height: 0; padding: 10px 16px; gap: 6px; }
.tabs button {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}

/* tournament heading */
.api-tournament-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#results-list > .api-tournament-header:first-child { border-top: 0; }

.api-tournament-header strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-right: 4px;
}

.tour-badge,
.level-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.3;
}

.tour-badge { background: var(--ink); color: var(--green); }
.level-badge { background: rgba(32,223,134,.14); color: var(--green); }

/* one match */
.match {
  grid-template-columns: minmax(0, 1fr) minmax(90px, auto) 130px;
  gap: 16px 24px;
  padding: 14px 20px;
}

.match-players { gap: 6px; min-width: 0; }

.match-players b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.match-players .flag {
  flex: 0 0 22px;
  width: 22px;
  text-align: center;
  font-size: 15px;
  line-height: 1;
}

.match-players .pname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-players .tick { color: var(--green-dark); font-size: 14px; }

.match-players b.loser { color: var(--muted); font-weight: 500; }

.match-round {
  margin-top: 2px;
  padding-left: 30px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.scores {
  justify-content: flex-end;
  font-size: 15px;
}

.scores b {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
}

.match-status,
.live-status {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  line-height: 1.35;
}

.live-status { font-weight: 800; }

.live-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #e5484d;
  vertical-align: 1px;
}

.api-message {
  padding: 28px 20px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .api-tournament-header { padding: 12px 16px; }
  .api-tournament-header strong { font-size: 15px; width: 100%; }

  .match {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 14px;
    padding: 12px 16px;
  }

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

  .scores { grid-column: 2; grid-row: 1; align-self: center; }
  .scores b { font-size: 14px; }

  .match-status,
  .live-status {
    grid-column: 1 / -1;
    text-align: left;
    padding-left: 30px;
    font-size: 12px;
  }

  .date-nav span { min-width: 120px; font-size: 15px; }
  .day-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .day-chips::-webkit-scrollbar { display: none; }
  .day-chips button { flex: 0 0 auto; }
}

/* =========================================================
   VIDEOS
   ========================================================= */

.video-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.video-tabs::-webkit-scrollbar { display: none; }

.video-tabs button {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.video-tabs button.selected {
  background: var(--ink);
  color: var(--green);
  border-color: var(--text);
}

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

.video-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 9px 26px rgba(5,19,24,.07);
  color: var(--text);
}

.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--ink);
  cursor: pointer;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.video-thumb:hover img { transform: scale(1.03); }

.video-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-thumb.ch-atp  { background: linear-gradient(135deg, #071217, #0d3b5c); }
.video-thumb.ch-wta  { background: linear-gradient(135deg, #2a0c3d, #7a2b8f); }
.video-thumb.ch-tour { background: linear-gradient(135deg, #071217, #07965a); }

.video-thumb .play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  transition: transform .2s ease;
}

.video-thumb .play svg { width: 20px; height: 20px; fill: var(--ink); margin-left: 3px; }

.video-thumb:hover .play { transform: scale(1.08); }

.video-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 16px;
}

.video-info small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.video-info strong {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-info a {
  margin-top: 2px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .video-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* =========================================================
   NEWS: lead story + list (same layout as YepFootball)
   ========================================================= */

.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.news-lead {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.news-lead .img-wrap {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
}

.news-lead img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.news-lead:hover img { transform: scale(1.02); }

.news-lead h3 {
  margin: 18px 0 10px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.8px;
}

.news-lead p {
  margin: 0;
  max-width: 60ch;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.5;
}

.news-lead:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.news-stack {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-stack li { border-top: 1px solid var(--line); }
.news-stack li:first-child { border-top: 0; }

.news-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  color: var(--text);
  text-decoration: none;
}

.news-stack li:first-child .news-row { padding-top: 0; }

.news-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.news-row:hover h3 {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-row img {
  width: 112px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
  display: block;
}

.news-time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.news-lead .news-time { margin-top: 10px; font-size: 13px; }

@media (max-width: 860px) {
  .news-layout { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
  .news-lead h3 { font-size: 24px; }
  .news-lead p { font-size: 15px; }
  .news-row { grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; }
  .news-row img { width: 96px; }
  .news-row h3 { font-size: 15px; }
}

/* =========================================================
   RESULTS: two columns of match cards (v16)
   ========================================================= */

#results-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

#results-list > .api-tournament-header,
#results-list > .api-message,
#results-list > .loading {
  grid-column: 1 / -1;
  border-radius: 8px;
  border: 0;
  margin-top: 6px;
}

#results-list > .api-tournament-header:first-child { margin-top: 0; }

.match-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
}

.match-card.is-live { border-color: rgba(229,72,77,.6); }

.mc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.mc-status { color: var(--muted); }
.mc-status.live-status { color: #ff6b6f; }

.mc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.mc-row .flag { flex: 0 0 22px; text-align: center; font-size: 15px; line-height: 1; }
.mc-row .pname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-row .tick { color: var(--green); font-size: 14px; }
.mc-row.loser { color: var(--muted); font-weight: 500; }

.mc-sets {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.mc-sets .set {
  min-width: 24px;
  height: 26px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.mc-sets .set.won { color: var(--text); font-weight: 800; }
.mc-sets sup { font-size: 9px; margin-left: 1px; align-self: flex-start; margin-top: 3px; line-height: 1; }

.is-live .mc-sets .set:last-child { background: rgba(32,223,134,.16); color: var(--green); }

.mc-score-text {
  text-align: right;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.mc-times {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.mc-times b { color: var(--text-dim); font-weight: 700; }

@media (max-width: 760px) {
  #results-list { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .mc-row { font-size: 14px; }
}

/* =========================================================
   DARK GREEN THEME: details
   ========================================================= */

html { color-scheme: dark; }

.results-card,
.rankings-card,
.calendar-card { background: var(--surface); border-color: var(--line); }

.tabs button,
.day-chips button,
.video-tabs button { color: var(--text-dim); }

.tabs button.active,
.tabs button.selected,
.tabs button[aria-pressed="true"] { color: var(--green); }

.day-chips button { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.day-chips button.selected { background: var(--green); color: var(--ink); border-color: var(--green); }

.video-tabs button { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.video-tabs button.selected { background: var(--green); color: var(--ink); border-color: var(--green); }

.date-nav button { background: var(--surface-2); border-color: var(--line); color: var(--text); }

.tour-badge { background: var(--green); color: var(--ink); }

.news-row img, .news-lead .img-wrap { background: var(--surface-2); }

.legal-page a, .news-lead:hover h3, .news-row:hover h3 { color: var(--green); }

/* =========================================================
   RANKINGS + CALENDAR: two columns (v17)
   Reads down the left column first, then the right
   (1–10 | 11–20 for rankings; dates in order for the calendar).
   ========================================================= */

.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 10), auto);
  grid-auto-flow: column;
}

.two-col-grid > * {
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.two-col-grid .ranking-item:last-child,
.two-col-grid .calendar-item:last-child { border-bottom: 0; }

/* larger, easier-to-read rankings */
.two-col-grid .ranking-item {
  grid-template-columns: 34px minmax(0, 1fr) auto 22px;
  gap: 12px;
  padding: 12px 18px;
  font-size: 14px;
}

.two-col-grid .ranking-rank { font-size: 15px; }
.two-col-grid .ranking-name b { font-size: 14px; }
.two-col-grid .ranking-bio {
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.two-col-grid .ranking-points { font-size: 12px; font-variant-numeric: tabular-nums; }

/* larger, easier-to-read calendar */
.two-col-grid .calendar-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "name badge"
    "meta date";
  gap: 4px 12px;
  padding: 14px 18px;
}

.two-col-grid .calendar-item > div { display: contents; }
.two-col-grid .calendar-item b { grid-area: name; font-size: 14px; }
.two-col-grid .calendar-item > div > span { grid-area: meta; font-size: 12px; }
.two-col-grid .calendar-badge { grid-area: badge; justify-self: end; font-size: 10px; }
.two-col-grid .calendar-item small { grid-area: date; justify-self: end; font-size: 12px; }

@media (min-width: 761px) {
  /* thin dividing line between the two columns */
  .two-col-grid {
    background:
      linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat;
  }
  /* last item of the left column: no bottom border */
  .two-col-grid > .col-end { border-bottom: 0; }
}

@media (max-width: 760px) {
  .two-col-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
  }
  .two-col-grid .ranking-item { padding: 12px 14px; }
  .two-col-grid .calendar-item { padding: 12px 14px; }
}

/* =========================================================
   v18: calendar end dates + sticky day bar in Results
   ========================================================= */

.cal-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cal-dates .cal-arrow { color: var(--green); font-weight: 800; }

/* the card must not clip, or sticky won't work */
#results .results-card { overflow: visible; }

.results-sticky {
  position: sticky;
  top: 68px;                 /* just under the site header */
  z-index: 20;
  background: var(--surface);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 8px 16px -10px rgba(0,0,0,.6);
}

.results-sticky .date-nav { border-radius: 10px 10px 0 0; background: var(--surface); }
.results-sticky .day-chips { background: var(--surface); border-bottom: 1px solid var(--line); }

@media (max-width: 720px) {
  .results-sticky { top: 62px; }
  .results-sticky .date-nav { padding: 8px 12px; }
  .results-sticky .date-nav button { width: 34px; height: 34px; }
  .results-sticky .day-chips { padding: 8px 12px; }
  .results-sticky .day-chips button { padding: 7px 13px; }
}

/* =========================================================
   GRAND SLAMS (v19): featured next Slam + three compact tiles
   Photos from Unsplash (free licence), matched to each surface.
   ========================================================= */

.slam-board {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 14px;
}

.slam-others {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 14px;
}

.slam-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  padding: 16px 18px;
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  text-decoration: none;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

.slam-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: var(--ink);
  background-size: cover;
  background-position: center;
  transition: transform .45s ease;
}

.slam-tile:hover::before { transform: scale(1.05); }

.slam-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgba(3,14,9,.92) 0%, rgba(3,14,9,.55) 45%, rgba(3,14,9,.15) 100%);
}

.slam-tile.ao::before { background-image: url("https://images.unsplash.com/photo-1595435934249-5df7ed86e1c0?auto=format&fit=crop&w=1200&q=80"); }
.slam-tile.rg::before { background-image: url("https://images.unsplash.com/photo-1554068865-24cecd4e34b8?auto=format&fit=crop&w=1200&q=80"); }
.slam-tile.wb::before { background-image: url("https://images.unsplash.com/photo-1533973269412-434f9b15fb05?auto=format&fit=crop&w=1200&q=80"); }
.slam-tile.us::before { background-image: url("https://images.unsplash.com/photo-1560012057-4372e14c5085?auto=format&fit=crop&w=1200&q=80"); }

.slam-tile.featured { min-height: 410px; padding: 24px 26px; }

.slam-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

/* original surface badges (hard = blue, clay = orange, grass = green) */
.slam-badge {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 8px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .5px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.slam-badge.surf-hard  { background: #1f5fae; }
.slam-badge.surf-clay  { background: #c4562b; }
.slam-badge.surf-grass { background: #2f7d32; }
.featured .slam-badge { min-width: 56px; height: 56px; font-size: 18px; }

.slam-weather {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(3,14,9,.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 13px;
  white-space: nowrap;
}
.slam-weather b { font-size: 15px; }
.slam-weather small { color: rgba(255,255,255,.75); font-size: 11px; }

.slam-tile-body h3 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -.5px;
}
.featured .slam-tile-body h3 { font-size: clamp(36px, 4.4vw, 56px); letter-spacing: -1.5px; }

.slam-tile-body p {
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 600;
}
.featured .slam-tile-body p { font-size: 15px; }
.slam-tile-body .slam-dates { margin-top: 2px; color: rgba(255,255,255,.7); font-weight: 500; }

.slam-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.slam-count {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(32,223,134,.18);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}
.featured .slam-count { margin-top: 16px; padding: 8px 16px; font-size: 17px; }
.featured .slam-count b { font-size: 28px; margin-right: 2px; }
.slam-count.live { background: rgba(229,72,77,.22); color: #ff8a8d; }

@media (max-width: 860px) {
  .slam-board { grid-template-columns: 1fr; }
  .slam-tile.featured { min-height: 340px; }
  .slam-others { grid-template-rows: none; }
}

@media (max-width: 480px) {
  .slam-tile { min-height: 132px; padding: 14px 15px; }
  .slam-tile.featured { min-height: 300px; padding: 18px; }
  .slam-badge { min-width: 36px; height: 36px; font-size: 12px; }
  .slam-weather small { display: none; }
}
.slam-others .slam-count { position: absolute; right: 18px; bottom: 16px; margin: 0; }
.slam-others .slam-tile-body { padding-right: 110px; }
.slam-others .slam-tile-body h3 { margin-top: 6px; }
