/* =========================================================================
   SportBaseline Tennis — global stylesheet (mirror of football style.css)
   Only differences vs football: --tn-accent (#B6F500) replaces ff-accent.
   ========================================================================= */
:root {
  --tn-bg:        #fafbfc;
  --tn-bg-soft:   #f3f4f6;
  --tn-bg-card:   #ffffff;
  --tn-line:      #e5e7eb;
  --tn-line-2:    #d1d5db;
  --tn-text:      #111827;
  --tn-text-soft: #4b5563;
  --tn-text-2:    #4b5563;
  --tn-muted:     #6b7280;
  --tn-accent:    #B6F500;
  --tn-accent-2:  #94c800;
  --tn-accent-3:  #7da800;
  --tn-success:   #059669;
  --tn-warn:      #d97706;
  --tn-danger:    #dc2626;
  --tn-blue:      #1e3a5f;
  --tn-red:       #c0392b;
  --tn-radius:    10px;
  --tn-shadow:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --tn-shadow-lg: 0 10px 30px rgba(0,0,0,.08);
  --tn-pad-x:     24px;
  --tn-header-h:  60px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--tn-text);
  background: var(--tn-bg);
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--tn-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: 'Sora', 'Inter', sans-serif; line-height: 1.2; margin: 0 0 .5em; color: #0b1220; font-weight: 800; }
.tn-link { color: var(--tn-text); border-bottom: 1px solid var(--tn-accent); padding-bottom: 1px; }
.tn-link:hover { background: var(--tn-accent); text-decoration:none; }
.tn-skip-link { position:absolute; left:-9999px; }
.tn-skip-link:focus { left:8px; top:8px; background:var(--tn-accent); color:#000; padding:8px 12px; z-index:1000; border-radius:6px; }
.tn-container { width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 var(--tn-pad-x); }
.tn-main      { min-height: 60vh; flex: 1 0 auto; }
.tn-footer    { flex-shrink: 0; }

/* ---------- header ---------- */
.tn-header {
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 3px solid var(--tn-accent);
  position: sticky; top: 0; z-index: 50;
}
.tn-header__inner {
  width: 100%; max-width: none; margin: 0;
  padding: 0 28px;
  display: flex; align-items: center; gap: 18px;
  height: var(--tn-header-h);
}
.tn-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Sora', sans-serif; font-weight: 800;
  font-size: 1.55rem; letter-spacing: -0.02em;
  color: var(--tn-text); margin-right: 16px;
}
.tn-logo:hover { text-decoration: none; }
.tn-logo__text { display: inline-flex; align-items: baseline; line-height: 1; }
.tn-logo__sport    { color: #0b1220; font-weight: 800; }
.tn-logo__baseline { color: var(--tn-accent-3); font-weight: 800; }
.tn-logo__branch   { font-size:.85rem; font-weight:700; padding:2px 10px; background: var(--tn-accent); color:#000; border-radius: 4px; }
.tn-search-wrap, .tn-search { margin-left: auto; }
@media (max-width: 900px) {
  .tn-logo { font-size: 1.3rem; margin-right: 8px; }
  .tn-header__inner { padding: 0 16px; }
}
.tn-hamburger { display:none; background:none; border:0; padding:8px; cursor:pointer; flex-direction:column; gap:4px; }
.tn-hamburger span { display:block; width:22px; height:2px; background:#000; }
.tn-nav { display: flex; gap: 2px; flex: 1; align-items: center; }
.tn-nav__link, .tn-nav__dropdown button {
  color: var(--tn-text); padding: 7px 12px; border-radius: 6px;
  font-weight: 600; font-size: .88rem; background: transparent;
  border: 0; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.tn-nav__link:hover, .tn-nav__dropdown button:hover { background: var(--tn-bg-soft); text-decoration: none; }
.tn-nav__link.is-active, .tn-nav__dropdown button.is-active { background: transparent; color: var(--tn-text); }

.tn-nav__dropdown { position: relative; }

/* mega menu */
.tn-nav__dropdown--mega { position: relative; }
.tn-nav__dropdown--mega .tn-mega {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  transform: translateY(-4px);
  background: #fff;
  border: 1px solid var(--tn-line);
  border-radius: 12px;
  padding: 22px 8px;
  display: grid;
  gap: 0;
  box-shadow: var(--tn-shadow-lg);
  z-index: 100;
  opacity: 0; visibility: hidden;
  transition: opacity .14s, transform .14s, visibility .14s;
}
.tn-nav__dropdown--mega .tn-mega[data-cols="2"] { grid-template-columns: repeat(2, minmax(220px, 260px)); width: 540px; }
.tn-nav__dropdown--mega .tn-mega[data-cols="3"] { grid-template-columns: repeat(3, minmax(220px, 260px)); width: 800px; }
.tn-nav__dropdown--mega .tn-mega[data-cols="4"] { grid-template-columns: repeat(4, minmax(210px, 240px)); width: 1000px; }
.tn-nav__dropdown--mega.is-open .tn-mega {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}
.tn-mega__col { padding: 0 14px; display: flex; flex-direction: column; }
.tn-mega__col + .tn-mega__col { border-left: 1px solid var(--tn-line); }
.tn-mega__title {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: var(--tn-muted); text-transform: uppercase;
  margin: 0 0 12px 8px;
  font-family: 'Inter', sans-serif;
}
.tn-mega__col a {
  display: block; padding: 8px 8px; border-radius: 6px;
  color: var(--tn-text); font-size: .85rem;
  text-decoration: none;
}
.tn-mega__col a:hover { background: var(--tn-bg-soft); text-decoration: none; }
.tn-mega__col a:hover .tn-mega__name { color: var(--tn-accent-3); }
.tn-mega__name { display: block; font-weight: 600; line-height: 1.25; }
.tn-mega__desc {
  display: block; font-size: .76rem; color: var(--tn-muted);
  margin-top: 2px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tn-mega__viewall {
  color: var(--tn-accent-3) !important; font-weight: 600 !important;
  font-size: .8rem !important; margin-top: auto;
  padding-top: 10px !important; padding-bottom: 4px !important;
}
.tn-mega__viewall:hover { background: transparent !important; text-decoration: underline !important; }

/* mobile nav */
@media (max-width: 1100px) {
  .tn-hamburger { display: inline-flex; }
  .tn-nav { display:none; position:absolute; top: var(--tn-header-h); left:0; right:0; background:#fff; flex-direction:column; padding:14px 24px; gap:6px; border-bottom: 3px solid var(--tn-accent); z-index:60; align-items:flex-start; }
  .tn-nav.is-open { display:flex; }
  .tn-nav__dropdown--mega .tn-mega { position: static; width: 100% !important; grid-template-columns: 1fr !important; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 6px 0; }
  .tn-mega__col + .tn-mega__col { border-left: 0; border-top: 1px solid var(--tn-line); padding-top: 10px; margin-top: 8px; }
  .tn-search-wrap { margin-left: auto; }
}

/* search */
.tn-search-wrap { position: relative; }
.tn-search { display:flex; gap:4px; }
.tn-search input { border: 1px solid var(--tn-line-2); padding: 8px 14px; border-radius: 999px; font: inherit; font-size: .88rem; width: 240px; outline: none; background: var(--tn-bg-soft); transition: all .2s; }
.tn-search input:focus { border-color: var(--tn-accent-3); }
.tn-search button, .tn-search button[type="submit"] { width: 38px !important; height: 38px !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: var(--tn-accent) !important; color: #0b1220 !important; cursor: pointer; font-size: 1rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(182,245,0,.4); transition: transform .12s, filter .15s; flex-shrink: 0; } .tn-search button:hover { transform: translateY(-1px); filter: brightness(1.1); }

/* ---------- buttons ---------- */
.tn-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; font-weight: 600;
  border: 1px solid var(--tn-line-2); background: #fff; color: var(--tn-text);
  cursor: pointer; font-size: .88rem; transition: all .15s; text-decoration: none;
}
.tn-btn:hover { background: var(--tn-bg-soft); text-decoration: none; }
.tn-btn--primary {
  background: linear-gradient(135deg, var(--tn-accent) 0%, var(--tn-accent-2) 100%);
  color: #000; border-color: transparent;
  box-shadow: 0 4px 12px rgba(148,200,0,.25);
}
.tn-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(148,200,0,.35); }
.tn-btn--ghost { background: transparent; border-color: var(--tn-line); }
.tn-btn--sm { padding: 6px 12px; font-size: .78rem; }
.tn-pill { display:inline-block; padding:3px 10px; border:1px solid var(--tn-line); border-radius:999px; font-size:.78rem; font-weight:600; background:#fff; color: var(--tn-text); text-decoration:none; }

/* ---------- hero (home) ---------- */
.tn-hero {
  position: relative;
  color: #fff;
  padding: 60px 0 50px;
  min-height: calc(80vh - 400px);
  display: flex; flex-direction: column; justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  background: #0b1220;
}
.tn-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(90deg, rgba(11,18,32,.55) 0%, rgba(11,18,32,.25) 45%, rgba(11,18,32,.05) 100%),
    url('/tennis/assets/img/hero-goat-v3.jpg') center/cover no-repeat;
}
.tn-hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.08) 0%, rgba(0,0,0,.35) 100%);
}
.tn-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0 0 18px;
  color: #fff; letter-spacing: -1px; font-weight: 800;
  text-shadow: 0 2px 20px rgba(0,0,0,.4);
}
.tn-hero p  { font-size: 1.15rem; opacity: .9; max-width: 720px; margin: 0 auto 36px; color:#fff; }
.tn-hero__search { max-width: 680px; margin: 0 auto; display: flex; gap: 8px; }
.tn-hero__search input {
  flex: 1; padding: 16px 22px; border: 0; border-radius: 999px;
  font: inherit; font-size: 1rem; outline: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.tn-hero__search button {
  padding: 16px 32px; border: 0; border-radius: 999px;
  background: var(--tn-accent); color: #000; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.tn-didyouknow {
  margin-top:24px;padding:14px 18px;border-radius:10px;
  background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.10);
  font-size:.95rem;display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:space-between;
}
.tn-didyouknow__lbl { color: var(--tn-accent); }
.tn-didyouknow__actions { display:flex;gap:10px;align-items:center;flex-wrap:wrap; }

/* legacy hero variants (for older pages) */
.tn-hero__title { color:#fff; font-size:2.6rem; margin:0 0 14px; }
.tn-hero__title .tn-accent { color: var(--tn-accent); }
.tn-hero__sub { color:#fff; opacity:.85; font-size:1.05rem; margin:0 auto 24px; max-width:760px; }
.tn-hero__cta { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }

/* ---------- sections ---------- */
.tn-section { padding: 48px 0; }
.tn-section--soft { background: var(--tn-bg-soft); }
.tn-section--alt  { background: var(--tn-bg-soft); border-top:1px solid var(--tn-line); border-bottom:1px solid var(--tn-line); }
.tn-section--narrow { padding: 28px 0 8px; }
.tn-section__head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.tn-section__head h2 { font-size: 1.55rem; margin: 0; }
.tn-section__head p  { color: var(--tn-muted); margin: 6px 0 0; font-size: .92rem; }
.tn-section__head a  { font-weight: 600; font-size: .88rem; }
.tn-section__head--sm h2 { font-size: 1.25rem; }
.tn-section__title { font-size:1.6rem; margin:0 0 18px; }

/* ---------- card grids ---------- */
.tn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tn-card {
  background: var(--tn-bg-card);
  border: 1px solid var(--tn-line);
  border-radius: var(--tn-radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--tn-shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tn-card:hover { transform: translateY(-2px); box-shadow: var(--tn-shadow-lg); border-color: var(--tn-line-2); }
.tn-card__head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:12px; }
.tn-card__title { margin:0; font-size:1.15rem; }
.tn-card__meta { font-size:.82rem; color: var(--tn-muted); font-weight:500; }
.tn-card__foot { margin-top:10px; padding-top:10px; border-top:1px solid var(--tn-line); }
.tn-grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap:18px; }
.tn-grid-3 { display:grid; grid-template-columns: repeat(3, 1fr); gap:18px; margin-bottom:18px; }
@media (max-width: 900px) { .tn-grid-2, .tn-grid-3 { grid-template-columns: 1fr; } }

/* ---------- featured cards (top tournaments) ---------- */
.tn-feat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
@media (max-width: 1300px) { .tn-feat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .tn-feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .tn-feat-grid { grid-template-columns: 1fr; } }
.tn-feat-card {
  display: block; background: #fff; border: 1px solid var(--tn-line);
  border-radius: 12px; overflow: hidden;
  color: inherit; text-decoration: none; transition: all .15s;
}
.tn-feat-card:hover { transform: translateY(-3px); box-shadow: var(--tn-shadow-lg); text-decoration: none; border-color: var(--tn-accent); }
.tn-feat-card__head {
  padding: 14px 18px; background: var(--tn-bg-soft);
  color: var(--tn-text); display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--tn-line);
}
.tn-feat-card__head h3 { color: var(--tn-text); font-size: 1.02rem; margin: 0; font-weight: 700; }
.tn-feat-card__head small { font-size: .7rem; color: var(--tn-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.tn-feat-card__body { padding: 6px 16px 12px; }
.tn-feat-card__row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--tn-line);
}
.tn-feat-card__row:last-child { border-bottom: 0; }
.tn-feat-card__row > .tn-table__rank {
  font-size: .78rem; color: var(--tn-muted); font-weight: 700; font-variant-numeric: tabular-nums;
}
.tn-feat-card__id strong {
  display: block;
  font-weight: 700; font-size: .88rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tn-feat-card__id span {
  display: block;
  font-size: .72rem; color: var(--tn-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.tn-feat-card__row b {
  color: var(--tn-accent-3); font-weight: 800; font-size: .82rem;
  font-variant-numeric: tabular-nums; min-width: 28px; text-align: right;
}

/* ---------- today's matches grid (mirror of ff-today-grid) ---------- */
.tn-today-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.tn-today-card {
  display:block; background:#fff; border:1px solid var(--tn-line);
  border-radius: 10px; padding: 12px 14px;
  color: inherit; text-decoration: none; transition: all .15s;
}
.tn-today-card:hover { transform: translateY(-1px); box-shadow: var(--tn-shadow-lg); border-color: var(--tn-accent); }
.tn-today-card__head {
  display:flex; justify-content:space-between; align-items:center;
  font-size:.74rem; color: var(--tn-muted); margin-bottom:8px;
  text-transform:uppercase; letter-spacing:.04em; font-weight:600;
}
.tn-today-card__comp { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width: 60%; }
.tn-today-card__teams { display:flex; flex-direction:column; gap:4px; }
.tn-today-card__row { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:.92rem; }
.tn-today-card__row.is-winner { color: var(--tn-text); font-weight:700; }
.tn-today-card__row span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; min-width:0; }
.tn-today-card__row b { font-weight:800; font-variant-numeric: tabular-nums; }
.tn-today-card__score { font-size:.78rem; color: var(--tn-muted); margin-top:6px; padding-top:6px; border-top:1px solid var(--tn-line); }

/* ---------- on-this-day grid ---------- */
.tn-otd-grid {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px;
}
.tn-otd-head {
  font-size:1rem; margin:0 0 10px; color: var(--tn-muted);
  text-transform:uppercase; letter-spacing:.04em;
}
.tn-otd-list { display:flex; flex-direction:column; gap:8px; }
.tn-otd-row {
  display:grid; grid-template-columns: auto 1fr auto; gap:12px; align-items:center;
  padding:10px 12px; background:#fff; border:1px solid var(--tn-line); border-radius: 8px;
  text-decoration:none; color: inherit; transition: all .15s;
}
.tn-otd-row--card { grid-template-columns: 40px 1fr auto; }
.tn-otd-row:hover { border-color: var(--tn-accent); box-shadow: var(--tn-shadow); text-decoration:none; }
.tn-otd-year { color: var(--tn-accent-3); font-size:.85rem; font-feature-settings:'tnum'; font-weight:800; min-width: 38px; text-align:right; white-space:nowrap; }
.tn-otd-row--card > .tn-pavatar { flex: 0 0 auto; }
.tn-otd-text { min-width:0; }
.tn-otd-text strong { font-size:.92rem; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tn-otd-text span   { font-size:.74rem; color: var(--tn-muted); display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tn-otd-row--card .tn-pavatar--sm { width: 40px; height: 40px; font-size: .78rem; margin: 0; }

/* ---------- mini list (3-col grid) ---------- */
.tn-mini-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px;
}
.tn-mini-list {
  background: #fff; border: 1px solid var(--tn-line); border-radius: 10px; overflow: hidden;
}
.tn-mini-row {
  display:flex; gap:12px; align-items:center; padding:11px 14px;
  border-bottom: 1px solid var(--tn-line); color: inherit; text-decoration: none;
}
.tn-mini-row:last-child { border-bottom: 0; }
.tn-mini-row:hover { background: var(--tn-bg-soft); text-decoration: none; }
.tn-mini-rank { font-weight:800; color: var(--tn-muted); font-variant-numeric: tabular-nums; min-width: 38px; font-size:.85rem; }
.tn-mini-text { flex:1; min-width:0; }
.tn-mini-text strong { font-size:.9rem; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tn-mini-text span   { font-size:.74rem; color: var(--tn-muted); }

.tn-accent-strong { color: var(--tn-accent-3); }

/* ---------- DENSE TABLE (mirror football's ff-table) ---------- */
.tn-table-wrap {
  background: #fff; border: 1px solid var(--tn-line); border-radius: var(--tn-radius);
  overflow: hidden;
}
.tn-table-toolbar {
  display: flex; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--tn-line); background: var(--tn-bg-soft);
  flex-wrap: wrap; align-items: center;
}
.tn-table-toolbar input,
.tn-table-filter {
  flex: 1; min-width: 200px; padding: 7px 12px;
  border: 1px solid var(--tn-line-2); border-radius: 6px; font: inherit; font-size: .85rem;
  background: #fff; outline: none;
}
.tn-table-toolbar input:focus { border-color: var(--tn-accent-3); }
.tn-tablewrap { overflow-x: auto; }
.tn-table {
  width: 100%; border-collapse: collapse; background: #fff;
  font-size: .82rem;
}
.tn-table th, .tn-table td {
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--tn-line);
  vertical-align: middle; white-space: nowrap;
}
.tn-table thead th {
  background: linear-gradient(180deg, var(--tn-bg-soft) 0%, #e5e7eb 100%);
  font-weight: 700; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .5px; color: var(--tn-text-soft);
  position: sticky; top: 0; z-index: 2; user-select: none;
}
.tn-th-sortable:hover { background: linear-gradient(180deg, #e5e7eb 0%, #d1d5db 100%); cursor: pointer; }
.tn-th-sortable::after { content: '↕'; opacity: .35; margin-left: 4px; font-size: .85em; }
.tn-th-sortable.is-sorted-asc::after  { content: '↑'; opacity: 1; color: var(--tn-accent-3); }
.tn-th-sortable.is-sorted-desc::after { content: '↓'; opacity: 1; color: var(--tn-accent-3); }
.tn-table tbody tr:nth-child(odd)  { background: #fafbfc; }
.tn-table tbody tr:nth-child(even) { background: #fff; }
.tn-table tbody tr:hover { background: #f7fdde; }
.tn-table tbody tr:last-child td { border-bottom: 0; }
.tn-table__player { display: flex; align-items: center; gap: 8px; }
.tn-table__player img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: center 20%; image-rendering: -webkit-optimize-contrast; background: var(--tn-bg-soft); flex-shrink: 0; }
.tn-table__rank { color: var(--tn-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.tn-table--num th, .tn-table--num td { font-variant-numeric: tabular-nums; }
.tn-table--dense th, .tn-table--dense td { padding: 6px 8px; font-size:.86rem; }
.tn-table .tn-num { text-align:right; font-variant-numeric: tabular-nums; }
.tn-table--stats td:first-child { font-weight:600; }
.tn-table .tn-rank { font-weight:700; color:#000; white-space:nowrap; }
.tn-table .tn-score { font-weight:600; white-space:nowrap; }
.tn-table .tn-row-final { background: rgba(182, 245, 0, 0.12); }
.tn-table .tn-row-win td:nth-child(5) { color: #006400; font-weight:700; }
.tn-table .tn-row-loss td:nth-child(5) { color: var(--tn-red); font-weight:700; }
.tn-rowgap th { padding-top: 16px; background: var(--tn-bg-soft); }
.tn-winner { font-weight:700; }

/* ---------- tool cards (browse hub) ---------- */
.tn-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 980px) { .tn-tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tn-tool-grid { grid-template-columns: 1fr; } }
.tn-tool-card {
  background:#fff; border:1px solid var(--tn-line); border-radius: var(--tn-radius);
  padding: 20px 22px; text-decoration: none; color: inherit; display:block;
  transition: all .15s; box-shadow: var(--tn-shadow);
}
.tn-tool-card:hover { transform: translateY(-3px); box-shadow: var(--tn-shadow-lg); border-color: var(--tn-accent); text-decoration:none; }
.tn-tool-card h3 { font-size:1.05rem; margin:0 0 6px; }
.tn-tool-card p  { font-size:.86rem; color: var(--tn-muted); margin:0; line-height:1.4; }

/* ---------- pills (tour) ---------- */
.tn-tour-pill { display:inline-block; padding:1px 8px; border-radius:4px; font-size:.72rem; font-weight:800; letter-spacing:.04em; background:transparent; border:1.5px solid #000; white-space:nowrap; }
.tn-tour-pill--atp { background:transparent; color:#000; border-color:#000; }
.tn-tour-pill--wta { background:transparent; color: var(--tn-accent-3); border-color: var(--tn-accent-3); }
.tn-tour-pill--atp_qc, .tn-tour-pill--atp_fut, .tn-tour-pill--atp_d { background:transparent; color:#000; opacity:.7; } .tn-tour-pill--wta_qi { background:transparent; color: var(--tn-accent-3); opacity:.7; }
.tn-ioc { display:inline-block; font-weight:800; font-size:.78rem; padding:2px 6px; border:1px solid var(--tn-line-2); border-radius:3px; letter-spacing:.04em; }

/* ---------- live dot (matches football) ---------- */
.tn-live-dot {
  display:inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--tn-danger); margin-right: 8px;
  box-shadow: 0 0 0 0 rgba(220,38,38,.7); animation: tn-pulse 1.6s infinite;
  vertical-align: middle;
}
@keyframes tn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220,38,38,.6); }
  70% { box-shadow: 0 0 0 10px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}

/* ---------- filters & inputs (legacy pages) ---------- */
.tn-filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding: 12px 0 16px; margin-bottom: 8px; }
.tn-input { padding:7px 10px; border:1px solid var(--tn-line); border-radius:6px; font-size:.9rem; font-family:inherit; min-width:140px; }
.tn-input:focus { outline: 2px solid var(--tn-accent); outline-offset: 0; border-color: var(--tn-accent-3); }

/* ---------- pager (legacy + mirror) ---------- */
.tn-pager { display:flex; gap:4px; flex-wrap:wrap; justify-content:center; margin: 24px 0; }
.tn-page { padding:6px 11px; border:1px solid var(--tn-line); border-radius:5px; font-size:.86rem; font-weight:600; color: var(--tn-text); }
.tn-page:hover { background: var(--tn-accent); text-decoration:none; }
.tn-page.is-current { background:#000; color: var(--tn-accent); }
.tn-page.is-disabled { color: var(--tn-line-2); cursor: not-allowed; }
.tn-page-ellipsis { padding:6px 6px; }

/* ---------- rank deltas ---------- */
.tn-delta--up { color: #006400; font-weight:700; }
.tn-delta--down { color: var(--tn-red); font-weight:700; }
.tn-delta--flat { color: var(--tn-text-2); }
.tn-delta--new { color: var(--tn-text-2); font-weight:700; font-size:.72rem; }

/* ---------- crumbs ---------- */
.tn-crumbs { font-size:.85rem; color: var(--tn-text-2); margin-bottom: 14px; }
.tn-crumbs a { color: var(--tn-text-2); }

/* ---------- page heads (legacy) ---------- */
.tn-page-head {
  position: relative;
  margin: 0 0 32px;
  padding: 56px 0 44px;
  min-height: 220px;
  color: #fff;
  isolation: isolate;
}
.tn-page-head::before {
  content: '';
  position: absolute;
  z-index: -2;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  background:
    linear-gradient(135deg, rgba(11, 18, 32, 0.55) 0%, rgba(11, 18, 32, 0.45) 55%, rgba(11, 18, 32, 0.35) 100%),
    url('/tennis/assets/img/hero-tennis.webp') center/cover no-repeat;
  pointer-events: none;
}
.tn-page-head::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  background:
    radial-gradient(ellipse at 85% 15%, rgba(182, 245, 0, 0.30) 0%, transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(125, 168, 0, 0.18) 0%, transparent 60%);
  pointer-events: none;
}
.tn-page-head h1 { font-size: 2.2rem; margin: 0 0 8px; color: #fff; letter-spacing: -0.5px; }
.tn-page-head h1 span[style*="color"] { color: #B6F500 !important; }
.tn-page-head__meta { font-size: 0.95rem; color: rgba(255, 255, 255, 0.85); margin: 0; }
.tn-page-head .tn-profile-meta,
.tn-page-head .tn-profile-meta span { color: rgba(255, 255, 255, 0.9); }
.tn-page-head .tn-champion { background: transparent; color: rgba(255, 255, 255, 0.95); padding: 6px 0 0; margin-top: 6px; }
.tn-page-head .tn-champion strong,
.tn-page-head .tn-champion a { color: #B6F500 !important; }

/* ---------- player profile (legacy + mirror) ---------- */
.tn-profile-head { padding: 8px 0 24px; border-bottom: 3px solid var(--tn-accent); margin-bottom:24px; }
.tn-profile-name { font-size:2.4rem; margin:0 0 10px; }
.tn-profile-meta { display:flex; gap:14px; flex-wrap:wrap; font-size:.92rem; color: var(--tn-text-2); }
.tn-profile-meta span { white-space:nowrap; }
.tn-bignum { font-family: Sora, sans-serif; font-size:2.4rem; font-weight:900; line-height:1; }

/* ---------- H2H head ---------- */
.tn-h2h-head { display:grid; grid-template-columns: 1fr auto 1fr; gap:24px; align-items:center; padding: 24px 0; border-bottom: 3px solid var(--tn-accent); margin-bottom:24px; }
.tn-h2h-side { text-align:center; }
.tn-h2h-side h2 { font-size:1.4rem; margin:0 0 6px; }
.tn-h2h-score { text-align:center; display:flex; align-items:center; justify-content:center; gap:18px; }
.tn-h2h-num { font-family: Sora, sans-serif; font-size:3.8rem; font-weight:900; line-height:1; }
.tn-h2h-vs { font-size:.9rem; color: var(--tn-text-2); }
@media (max-width: 700px) { .tn-h2h-head { grid-template-columns: 1fr; } .tn-h2h-score { padding: 12px 0; } }
.tn-champion { display:inline-block; background:transparent; color:#111; padding: 6px 0; margin-top: 8px; font-weight:600; font-size:.95rem; } .tn-champion strong { color:#7da800; }

/* ---------- stats blocks ---------- */
.tn-stats { display:grid; grid-template-columns: repeat(4, 1fr); gap:18px; text-align:center; }
@media (max-width: 700px) { .tn-stats { grid-template-columns: repeat(2, 1fr); } }
.tn-stat { padding: 18px; background:#fff; border:1px solid var(--tn-line); border-radius: var(--tn-radius); }
.tn-stat__num { display:block; font-family: Sora, sans-serif; font-size:1.8rem; font-weight:900; color:#000; line-height:1; }
.tn-stat__lbl { display:block; font-size:.82rem; color: var(--tn-text-2); margin-top:6px; text-transform:uppercase; letter-spacing:.04em; }

/* ---------- match head ---------- */
.tn-match-head { padding: 16px 0 24px; border-bottom: 3px solid var(--tn-accent); margin-bottom: 24px; }
.tn-match-title { font-size:1.8rem; margin:0 0 12px; }
.tn-match-title .tn-vs { color: var(--tn-text-2); font-size:.7em; padding: 0 8px; font-weight:500; }
.tn-match-meta { display:flex; gap:12px; flex-wrap:wrap; font-size:.92rem; color: var(--tn-text-2); margin-bottom: 14px; }
.tn-match-meta strong { color:#000; font-size:1.1rem; }

/* ---------- footer ---------- */
.tn-footer { background:#000; color:#fff; padding: 40px 0 20px; margin-top: 40px; }
.tn-footer__inner { display:grid; grid-template-columns: repeat(4, 1fr); gap: 30px; max-width:1500px; margin:0 auto; padding: 0 24px; }
@media (max-width: 1100px) { .tn-footer__inner { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .tn-footer__inner { grid-template-columns: 1fr; } }
.tn-footer__col h4 { color: var(--tn-accent); font-size:.95rem; margin: 0 0 10px; text-transform:uppercase; letter-spacing:.06em; }
.tn-footer__col a { display:block; color:#fff; padding: 3px 0; font-size:.9rem; }
.tn-footer__col a:hover { color: var(--tn-accent); }
.tn-footer__bottom { max-width:1500px; margin: 20px auto 0; padding: 16px 24px 0; border-top: 1px solid #333; display:flex; align-items:center; flex-wrap:wrap; gap:14px; font-size:.85rem; color:#bbb; }

/* ---------- misc legacy ---------- */
.tn-empty { padding: 20px; text-align:center; color: var(--tn-text-2); }
.tn-lead { font-size:1.05rem; color: var(--tn-text-2); }
code { font-family: monospace; background: var(--tn-bg-soft); padding: 2px 6px; border-radius: 3px; font-size: .9em; }

/* ---------- player photos (added 2026-05-23) ---------- */
.tn-profile-head { display:flex; align-items:flex-start; gap:24px; flex-wrap:wrap; margin-bottom: 18px; }
.tn-profile-head__avatar {
  width: 140px; height: 140px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0,0,0,.08);
  border: 3px solid var(--tn-accent);
  display:flex; align-items:center; justify-content:center;
}
.tn-profile-head__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; image-rendering: -webkit-optimize-contrast; display:block; }
.tn-profile-head__avatar--initials {
  background: var(--tn-accent);
  color: #000;
  font-weight: 800;
  font-size: 2.4rem;
  letter-spacing: 1px;
}
.tn-profile-head__main { flex: 1 1 320px; min-width: 0; }

/* compact avatar for player list rows */
.tn-pavatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 800;
  vertical-align: middle;
  margin-right: 10px;
  flex-shrink: 0;
}
.tn-pavatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; image-rendering: -webkit-optimize-contrast; display:block; }
.tn-pavatar--initials { background-color: var(--tn-accent); background-image: none; color: #0a1a00; font-weight: 800; letter-spacing: -0.02em; text-transform: uppercase; line-height: 1; }

.tn-player-cell { display: flex; align-items: center; gap: 0; }
.tn-player-cell .tn-link { vertical-align: middle; }

@media (max-width: 700px) {
  .tn-profile-head__avatar { width: 96px; height: 96px; }
  .tn-profile-head__avatar--initials { font-size: 1.8rem; }
}

/* ---------- knockout bracket (R16 -> F, 4 columns, ~720px tall) ---------- */
.tn-bracket-section { margin: 24px 0; }
.tn-bracket-section__title {
  font-size: 1.2rem;
  margin: 0 0 12px;
  font-weight: 700;
}

.tn-bracket {
  --tn-bk-line: #d2d6dd;
  --tn-bk-gap-x: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--tn-bk-gap-x);
  align-items: stretch;
  overflow-x: auto;
  padding: 4px 2px 8px;
  min-height: 720px;
}
.tn-bracket__col {
  display: grid;
  grid-template-rows: auto repeat(16, 1fr);
  min-width: 200px;
  min-height: 0;
}
.tn-bracket__head {
  grid-row: 1;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tn-muted, #6b7280);
  padding: 6px 4px;
  border-bottom: 1px solid var(--tn-line, #e5e7eb);
  margin-bottom: 10px;
}
.tn-bracket__col--f .tn-bracket__head { color: #7da800; }

.tn-bracket__body { display: contents; }

.tn-bracket__col--r16 .tn-bracket__pair { grid-row: span 4; }
.tn-bracket__col--qf  .tn-bracket__pair { grid-row: span 8; }
.tn-bracket__col--sf  .tn-bracket__pair { grid-row: span 16; }
.tn-bracket__col--f   .tn-bracket__pair { grid-row: span 16; }

.tn-bracket__pair {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-height: 0;
  padding: 0 5px;
}
.tn-bracket__pair.is-solo { justify-content: center; }

.tn-bracket__col:not(.tn-bracket__col--f) .tn-bracket__pair:not(.is-solo)::after {
  content: '';
  position: absolute;
  right: calc(var(--tn-bk-gap-x) / -2);
  top: 25%;
  bottom: 25%;
  width: calc(var(--tn-bk-gap-x) / 2);
  border-top: 1px solid var(--tn-bk-line);
  border-right: 1px solid var(--tn-bk-line);
  border-bottom: 1px solid var(--tn-bk-line);
  pointer-events: none;
}
.tn-bracket__col:not(.tn-bracket__col--f) .tn-bracket__pair:not(.is-solo)::before {
  content: '';
  position: absolute;
  right: calc(var(--tn-bk-gap-x) / -1);
  top: 50%;
  width: calc(var(--tn-bk-gap-x) / 2);
  height: 1px;
  background: var(--tn-bk-line);
  pointer-events: none;
}

.tn-bracket__tie {
  display: block;
  background: #fff;
  border: 1px solid var(--tn-line, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tn-bracket__tie:hover { border-color: #000; box-shadow: 0 2px 6px rgba(0,0,0,.08); }

.tn-bracket__row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  font-size: .82rem;
  color: #666;
  border-bottom: 1px solid var(--tn-line, #e5e7eb);
}
.tn-bracket__row:last-child { border-bottom: 0; }
.tn-bracket__row.is-winner { color: #111; font-weight: 700; background: #fafdf3; }

.tn-bracket__seed {
  font-size: .7rem;
  color: #999;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.tn-bracket__row.is-winner .tn-bracket__seed { color: #555; }

.tn-bracket__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tn-bracket__sets { display: inline-flex; gap: 4px; align-items: center; }
.tn-bracket__set {
  display: inline-block;
  min-width: 14px;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #888;
}
.tn-bracket__set--w { color: #7da800; font-weight: 800; }

.tn-bracket__col--f .tn-bracket__tie { border: 1.5px solid #7da800; box-shadow: 0 2px 8px rgba(125, 168, 0, .15); }

/* ---------- early rounds (R128/R64/R32 collapsible, full width) ---------- */
.tn-early-rounds { margin: 24px 0; }
.tn-early-rounds__title {
  font-size: 1.2rem;
  margin: 0 0 12px;
  font-weight: 700;
}
.tn-collapsible {
  border: 1px solid var(--tn-line, #e5e7eb);
  border-radius: 6px;
  margin-bottom: 8px;
  background: #fff;
  overflow: hidden;
}
.tn-collapsible__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-weight: 700;
  font-size: .92rem;
  background: #fafafa;
}
.tn-collapsible__head::-webkit-details-marker { display: none; }
.tn-collapsible__head::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 8px;
  font-size: .8rem;
  color: #888;
  transition: transform .15s ease;
}
.tn-collapsible[open] > .tn-collapsible__head::before { transform: rotate(90deg); }
.tn-collapsible__head:hover { background: #f0f0f0; }
.tn-collapsible__label { flex: 1; }
.tn-collapsible__count {
  font-size: .78rem;
  color: #888;
  font-weight: 500;
}
.tn-collapsible__body {
  border-top: 1px solid var(--tn-line, #e5e7eb);
}
.tn-collapsible__body .tn-table { margin: 0; }

/* Highlight winner row in players table */
.tn-row-final { background: #fafdf3; }
.tn-row-final td { font-weight: 600; }

/* ---------- score per-set cells (early rounds tables) ---------- */
.tn-set-table th.tn-set-th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #888;
  text-align: center;
  width: 56px;
}
.tn-set-table td.tn-set-cell-wrap {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
  padding-left: 4px;
  padding-right: 4px;
}
.tn-set-cell { display: inline-flex; align-items: baseline; gap: 0; }
.tn-set-cell__w { color: #111; font-weight: 700; }
.tn-set-cell__sep { color: #bbb; padding: 0 2px; }
.tn-set-cell__l { color: #888; font-weight: 500; }
.tn-set-cell__tb {
  font-size: .62rem;
  color: #999;
  margin-left: 1px;
  font-weight: 600;
  vertical-align: super;
  line-height: 1;
}
.tn-set-cell__empty { color: #ddd; }
.tn-set-cell--wo {
  text-align: center;
  font-style: italic;
  color: #888;
  font-size: .78rem;
}

/* ---------- season switcher (tournament editions, top-right of header) ---------- */
.tn-page-head { position: relative; }
.tn-season-switcher {
  position: absolute;
  top: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  z-index: 2;
}
.tn-season-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border: 1.5px solid rgba(255,255,255,.7);
  border-radius: 6px;
  background: rgba(255,255,255,.95);
  color: #111;
  text-decoration: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: .95rem;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tn-season-btn:hover { background: #B6F500; color: #111; border-color: #B6F500; }
.tn-season-btn--disabled {
  color: rgba(255,255,255,.4);
  border-color: rgba(255,255,255,.2);
  background: rgba(255,255,255,.05);
  pointer-events: none;
}
.tn-season-select {
  padding: 9px 12px;
  border: 1.5px solid #7da800;
  border-radius: 6px;
  background: #f7fbe6;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  font-size: 1.05rem;
  color: #111;
  min-width: 86px;
}
.tn-season-select:hover { background: #eef5cf; }

@media (max-width: 760px) {
  .tn-season-switcher {
    position: static;
    margin: 12px 0 4px;
  }
}

/* Pull hero up to touch nav (cancel tn-section top padding) */
.tn-section > .tn-container > .tn-page-head:first-child,
.tn-section > .tn-container > .tn-page-head:nth-child(2) {
  margin-top: -48px;
}
.tn-page-head .tn-crumbs {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.tn-page-head .tn-crumbs a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.tn-page-head .tn-crumbs a:hover { border-bottom-color: #B6F500; color: #B6F500; }
.tn-page-head .tn-crumbs span { color: rgba(255, 255, 255, 0.95); }

/* ---------- Audit fix 2026-05-23: size modifiers for compact thumbs on home ---------- */
.tn-pavatar--xs { width: 28px; height: 28px; font-size: 0.62rem; margin-right: 6px; }
.tn-pavatar--sm { width: 32px; height: 32px; font-size: 0.66rem; margin-right: 8px; }
.tn-pavatar--md { width: 48px; height: 48px; font-size: 0.78rem; margin-right: 10px; }
/* dense tables: keep thumb tight to name */
.tn-table__player { display: inline-flex; align-items: center; gap: 0; }
.tn-table__player strong { vertical-align: middle; }
/* mini-row layout: thumb between rank and text */
.tn-mini-row .tn-pavatar { margin-right: 0; }
.tn-mini-row { gap: 8px; }
.tn-otd-row .tn-pavatar { margin-right: 0; }

/* ============ Final5 fixes — H2H avatars + ranking thumb + mobile responsive ============ */

/* H2H header circular avatars (Fix 3) */
.tn-h2h-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(0,0,0,.08);
  border: 3px solid var(--tn-accent);
  margin: 0 auto 12px;
  text-decoration: none;
  color: #000;
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: 1px;
}
.tn-h2h-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
  image-rendering: -webkit-optimize-contrast;
  display: block;
}
.tn-h2h-avatar--initials {
  background: var(--tn-accent);
  color: #0a1a00;
}

/* Ranking thumbnail cell (Fix 4) */
.tn-rank-thumb-cell { width: 44px; padding-right: 4px !important; }
.tn-rank-thumb-cell .tn-pavatar { margin-right: 0; }

/* ===================== Mobile responsive (Fix 1) ===================== */
@media (max-width: 768px) {
  /* Profile header collapses */
  .tn-profile-head { gap: 14px; }
  .tn-profile-head__avatar { width: 88px; height: 88px; border-width: 2px; }
  .tn-profile-head__avatar--initials { font-size: 1.6rem; }
  .tn-profile-head__main { flex: 1 1 100%; }
  .tn-profile-name { font-size: 1.4rem; line-height: 1.2; margin: 0 0 6px; }
  .tn-profile-meta { gap: 8px 12px; font-size: .82rem; row-gap: 4px; }
  .tn-profile-meta span { white-space: normal; }

  /* Cards stack to single column on mobile */
  .tn-grid-3 { grid-template-columns: 1fr !important; gap: 10px; }
  .tn-bignum { font-size: 2.2rem; }
  .tn-card { padding: 12px 14px; }
  .tn-card__title { font-size: 1rem; }

  /* Tables: force internal horizontal scroll, never page-level */
  .tn-card .tn-table,
  .tn-tablewrap .tn-table { font-size: .78rem; }
  .tn-table th, .tn-table td { padding: 6px 6px; }
  .tn-tablewrap { -webkit-overflow-scrolling: touch; }

  /* Wrap untagged tables (defensive — anything inside .tn-card scrolls internally) */
  .tn-card > table.tn-table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* H2H mobile: stack vertically, smaller avatars */
  .tn-h2h-head { grid-template-columns: 1fr; gap: 8px; padding: 14px 0; }
  .tn-h2h-avatar { width: 90px; height: 90px; border-width: 2px; font-size: 1.6rem; }
  .tn-h2h-num { font-size: 2.4rem; }
  .tn-h2h-side h2 { font-size: 1.1rem; }

  /* Ranking thumb stays small */
  .tn-rank-thumb-cell { width: 36px; }
  .tn-rank-thumb-cell .tn-pavatar { width: 28px; height: 28px; font-size: .58rem; }

  /* Tournament: prevent overflow in season switcher */
  .tn-season-switcher { flex-wrap: wrap; gap: 6px; }

  /* Container side padding tightens */
  .tn-container { padding-left: 14px; padding-right: 14px; }

  /* Crumbs wrap properly */
  .tn-crumbs { font-size: .82rem; line-height: 1.4; }
}

@media (max-width: 480px) {
  .tn-profile-head__avatar { width: 72px; height: 72px; }
  .tn-profile-name { font-size: 1.2rem; }
  .tn-bignum { font-size: 1.9rem; }
  .tn-h2h-num { font-size: 2rem; }
  .tn-h2h-avatar { width: 72px; height: 72px; font-size: 1.3rem; }
}

/* ============ Mobile overflow fixes — round 2 ============ */
@media (max-width: 768px) {
  /* Prevent any document-level horizontal scroll */
  html, body { overflow-x: hidden; max-width: 100vw; }

  /* Make .tn-table-wrap (with dash) scroll horizontally on mobile */
  .tn-table-wrap { overflow-x: auto !important; overflow-y: visible; -webkit-overflow-scrolling: touch; }
  .tn-table-wrap > .tn-table-toolbar { position: sticky; left: 0; }

  /* Compress topbar search */
  .tn-search input { min-width: 0; width: 100%; font-size: .82rem; padding: 6px 8px; }
  .tn-search-wrap { flex: 1 1 auto; min-width: 0; max-width: 60vw; }
  .tn-search { gap: 2px; }
  .tn-search button { padding: 6px 10px; font-size: .82rem; }

  /* Logo / topbar nav doesn't overflow */
  .tn-header__inner { gap: 8px; }

  /* Misc wide elements */
  .tn-pill { max-width: 100%; white-space: normal; }
}

@media (max-width: 480px) {
  .tn-search-wrap { max-width: 50vw; }
}

/* H2H meetings — per-set columns (added 2026-05-23) */
.tn-h2h-meetings .tn-set { text-align:center; font-variant-numeric: tabular-nums; font-size:.95rem; padding:6px 4px; min-width:48px; }
.tn-h2h-meetings .tn-set__win { font-weight:700; color: var(--tn-text); }
.tn-h2h-meetings .tn-set__dash { color: var(--tn-text-2); margin: 0 2px; }
.tn-h2h-meetings .tn-set__tb { font-size:.7em; vertical-align:super; color: var(--tn-text-2); margin-left:1px; }
.tn-h2h-meetings .tn-set--empty { color: var(--tn-text-2); }
.tn-h2h-meetings .tn-set--note { text-align:center; color: var(--tn-text-2); font-style:italic; font-size:.85rem; }
.tn-h2h-meetings th.tn-num { text-align:center; }


/* H2H lookup landing (added 2026-05-23, v3 — wider cards, stronger shadow, 2-row groups) */
.tn-h2h-lookup-hero { text-align:center; padding: 12px 0 24px; }
.tn-h2h-lookup-hero h1 { margin: 0 0 8px; }
.tn-h2h-lookup-hero .tn-lead { color: var(--tn-text-soft); margin: 0; }

.tn-h2h-form { display:grid; grid-template-columns: 1fr auto 1fr auto; gap: 12px; align-items:end; max-width: 880px; margin: 0 auto 36px; padding: 16px; background: var(--tn-bg-card); border: 1px solid var(--tn-line); border-radius: 10px; box-shadow: 0 4px 14px rgba(17,24,39,.08); }
.tn-h2h-form__field { position: relative; display:flex; flex-direction:column; gap:6px; }
.tn-h2h-form__field label { font-size:.72rem; color: var(--tn-muted); text-transform: uppercase; letter-spacing:.06em; font-weight: 600; }
.tn-h2h-form__field .tn-input { width: 100%; }
.tn-h2h-form__vs { font-weight:700; color: var(--tn-text-soft); padding-bottom: 12px; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.tn-h2h-form .tn-btn { padding: 10px 18px; height: 38px; }
@media (max-width: 700px){
  .tn-h2h-form { grid-template-columns: 1fr; }
  .tn-h2h-form__vs { display:none; }
}

.tn-ac-list { list-style:none; margin:0; padding:0; position:absolute; top:100%; left:0; right:0; background: var(--tn-bg-card); border: 1px solid var(--tn-line); border-top:none; border-radius: 0 0 8px 8px; max-height: 320px; overflow:auto; z-index: 20; box-shadow: 0 10px 24px rgba(17,24,39,.14); }
.tn-ac-item { display:flex; justify-content:space-between; align-items:center; padding: 8px 12px; cursor:pointer; gap: 10px; }
.tn-ac-item:hover, .tn-ac-item.is-active { background: var(--tn-bg-soft); }
.tn-ac-name { color: var(--tn-text); font-weight: 500; }
.tn-ac-meta { color: var(--tn-muted); font-size:.78rem; }

.tn-h2h-featured { margin: 0 0 28px; }
.tn-h2h-featured > h2.tn-card__title { margin: 0 0 12px; padding-left: 4px; font-size: 1.05rem; color: var(--tn-text); }
.tn-h2h-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.tn-h2h-card { display:flex; align-items:center; justify-content:space-between; gap: 12px; padding: 14px 16px; background: var(--tn-bg-card); border: 1px solid var(--tn-line); border-radius: 10px; text-decoration:none; color: var(--tn-text); transition: border-color .15s, transform .15s, box-shadow .15s; box-shadow: 0 2px 6px rgba(17,24,39,.06), 0 4px 12px rgba(17,24,39,.04); }
.tn-h2h-card:hover { border-color: var(--tn-line-2); transform: translateY(-2px); box-shadow: 0 6px 14px rgba(17,24,39,.10), 0 12px 24px rgba(17,24,39,.08); }
.tn-h2h-card__side { display:flex; align-items:center; gap:10px; flex: 1; min-width: 0; }
.tn-h2h-card__side--right { justify-content: flex-end; text-align:right; }
.tn-h2h-card__name { font-weight: 600; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; color: var(--tn-text); font-size: .95rem; }
.tn-h2h-card__vs { color: var(--tn-muted); font-size:.75rem; flex-shrink:0; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.tn-h2h-mini-avatar { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:50%; overflow:hidden; background: var(--tn-bg-soft); flex-shrink: 0; border: 1px solid var(--tn-line); }
.tn-h2h-mini-avatar img { width:100%; height:100%; object-fit: cover; object-position: center top; }
.tn-h2h-mini-avatar--initials { font-size:.78rem; font-weight: 700; color: var(--tn-text-soft); }

/* ATP Big 3 — exactly 3 per row on desktop */
.tn-h2h-featured--big3 .tn-h2h-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px){
  .tn-h2h-featured--big3 .tn-h2h-grid { grid-template-columns: 1fr; }
}

/* ---------- Djokovic tribute (and any future GOAT-style cards) ---------- */
.tn-goat-tribute { line-height: 1.6; }
.tn-goat-tribute p { margin: 0 0 14px; color: #222; }
.tn-goat-tribute p:last-of-type { margin-bottom: 0; }
.tn-goat-tribute .tn-card__subtitle { font-size: 1.05rem; font-weight: 700; margin: 18px 0 10px; color: #000; }
.tn-goat-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px; }
.tn-goat-list li { padding: 6px 0; border-bottom: 1px solid var(--tn-line); font-size: .92rem; color: #222; }
.tn-goat-list li b { color: #000; }
@media (max-width: 760px) { .tn-goat-list { grid-template-columns: 1fr; } }

/* ---------- Profile head trophy badge (Djokovic) ---------- */
.tn-profile-head__badge {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 4px 14px; margin-left: auto;
  min-width: 110px;
}
.tn-trophy-svg { width: 60px; height: 76px; display:block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
.tn-trophy-label { text-align: center; line-height: 1.1; }
.tn-trophy-label__top { display:block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #6b520c; }
.tn-trophy-label__bot { display:block; font-size: .82rem; font-weight: 800; letter-spacing: .04em; color: #000; margin-top: 2px; }
@media (max-width: 760px) {
  .tn-profile-head__badge { margin-left: 0; padding: 4px 0; }
  .tn-trophy-svg { width: 52px; height: 66px; }
}

/* ---------- GOAT trophy + hover tooltip after every Djokovic link ---------- */
a[href*="/player/novak-djokovic"] { position: relative; }
a[href*="/player/novak-djokovic"]::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-left: 5px;
  vertical-align: -2px;
  background: url('/tennis/assets/img/trophy-mini.svg') center/contain no-repeat;
  flex-shrink: 0;
}
a[href*="/player/novak-djokovic"]:hover::before {
  content: 'Number one of all time';
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
/* Don't repeat the trophy / tooltip inside the big tribute card or on the profile page */
.tn-profile-head a[href*="/player/novak-djokovic"]::after,
.tn-profile-head a[href*="/player/novak-djokovic"]:hover::before,
.tn-goat-tribute a[href*="/player/novak-djokovic"]::after,
.tn-goat-tribute a[href*="/player/novak-djokovic"]:hover::before,
.tn-mega a[href*="/player/novak-djokovic"]::after,
.tn-mega a[href*="/player/novak-djokovic"]:hover::before { content: none; }

/* === Sport switcher (shared across Football / Basketball / Tennis) — 2026-05-25 === */
.sb-switcher { position: relative; }
.sb-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: #B6F500;
  color: #000;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
  line-height: 1.4;
}
.sb-switcher__btn:hover { background: #94c800; }
.sb-switcher__caret { display: inline-block; font-size: 10px; transition: transform .2s; }
.sb-switcher.is-open .sb-switcher__caret { transform: rotate(180deg); }

.sb-switcher__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.05);
  padding: 14px;
  display: none;
  z-index: 200;
}
.sb-switcher.is-open .sb-switcher__panel { display: block; animation: sb-fadein .12s ease-out; }
@keyframes sb-fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sb-switcher__search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
}
.sb-switcher__search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 13px;
  color: #111827;
  padding: 6px 0;
  min-width: 0;
}
.sb-switcher__search input::placeholder { color: #6b7280; }
.sb-switcher__search button {
  background: #ea580c;
  color: #fff;
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.sb-switcher__search button:hover { background: #c2410c; }

.sb-switcher__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 4px 8px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.sb-switcher__divider::before,
.sb-switcher__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.sb-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #111827;
  transition: background .12s, transform .12s;
  margin-bottom: 2px;
}
.sb-tile:hover {
  background: #fff7ed;
  text-decoration: none;
  transform: translateX(2px);
}
.sb-tile--current {
  background: #f3f4f6;
  cursor: default;
}
.sb-tile--current:hover {
  background: #f3f4f6;
  transform: none;
}
.sb-tile__crest {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fafbfc;
  border: 1px solid #e5e7eb;
}
.sb-tile__icon { width: 30px; height: 30px; display: block; }
.sb-tile__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-tile__body b { font-weight: 700; font-size: 14px; color: #111827; line-height: 1.2; }
.sb-tile__body span { font-size: 11px; color: #6b7280; line-height: 1.3; }
.sb-tile__arrow {
  color: #9ca3af;
  font-size: 16px;
  transition: color .15s, transform .15s;
}
.sb-tile:hover .sb-tile__arrow { color: #ea580c; transform: translateX(2px); }
.sb-tile__badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ea580c;
  background: #fff;
  border: 1px solid #fed7aa;
  padding: 3px 8px;
  border-radius: 999px;
}

@media (max-width: 600px) {
  .sb-switcher__panel { right: -10px; left: -10px; width: auto; }
}

/* ============ Live now (tennis home) ============ */
.tn-live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #B6F500;
  box-shadow: 0 0 0 0 rgba(182, 245, 0, .65);
  animation: tn-live-pulse 1.6s ease-out infinite;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid #7da800;
}
@keyframes tn-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(125, 168, 0, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(125, 168, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(125, 168, 0, 0); }
}
.tn-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.tn-live-card {
  display: block;
  background: linear-gradient(180deg, #fff 0%, #f7ffd6 100%);
  border: 1px solid #d9f29a;
  border-radius: 8px;
  padding: 8px 12px;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tn-live-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(125, 168, 0, .18); }
.tn-live-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tn-muted, #6b7280);
  margin-bottom: 6px;
  gap: 6px;
}
.tn-live-card__comp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-live-card__tour { font-weight: 800; padding: 1px 6px; border-radius: 3px; font-size: .58rem; flex-shrink: 0; }
.tn-live-card__tour--atp { background: #1f2937; color: #B6F500; }
.tn-live-card__tour--wta { background: #B6F500; color: #1f2937; }
.tn-live-card__row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
  font-size: .85rem;
}
.tn-live-card__flag { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; }
.tn-live-card__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-live-card__row.is-winner .tn-live-card__name { color: #15803d; font-weight: 700; }
.tn-live-card__sets { display: inline-flex; gap: 4px; font-variant-numeric: tabular-nums; }
.tn-live-card__sets b { font-weight: 800; font-size: .92rem; color: #111; min-width: 14px; text-align: right; }
.tn-live-card__row.is-winner .tn-live-card__sets b { color: #15803d; }
