/* While Inter downloads, text is drawn in Arial sized and spaced to match it, so the page doesn't reflow when Inter arrives. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.06%;
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
}

:root {
  --bg: #0b0f14;
  --panel: #121822;
  --panel-2: #182231;
  --border: #223047;
  --text: #e7edf5;
  --muted: #8ea0b8;
  --cricket: #2fd77f;
  --tennis: #ffcc33;
  --accent: #4f8cff;
  --danger: #ff5c5c;
  --danger-text: #ff8080;
  --accent-strong: #2f6bdf;
  --accent-text: #6fa3ff;
  --radius: 14px;
  --topbar-bg: rgba(11, 15, 20, 0.85);
  --skeleton-shine: #202c40;
}

:root[data-theme="light"] {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-2: #eef2f7;
  --border: #dbe3ee;
  --text: #16202c;
  --muted: #5c6b7f;
  --danger-text: #b02020;
  --accent-text: #1f56c4;
  --topbar-bg: rgba(245, 247, 250, 0.85);
  --skeleton-shine: #f8fafc;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Inter Fallback", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
}

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

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.brand-logo { width: 28px; height: 28px; flex: none; border-radius: 7px; }
.brand-live { color: var(--accent); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav-item i { font-size: 18px; width: 20px; text-align: center; }

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 16px 12px 6px;
}

.main-col { flex: 1; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page {
  padding: 24px;
  max-width: 1200px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.grid {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid > *, .cricket-main { min-width: 0; }

.widget-card { align-self: start; }
.cricket-widget {
  display: block;
  width: 100%;
  margin: 0 auto;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color-scheme: light;
}
.cricket-widget-score { max-width: 300px; height: 300px; }
.cricket-widget-matches { max-width: 400px; height: 300px; }
.cricket-widget-vertical { max-width: 250px; height: 600px; }
.cricket-widget-preview { display: flex; flex-direction: column; background: var(--panel-2); border: 1px solid var(--border); color-scheme: normal; }
.preview-heading { padding: 12px; border-bottom: 1px solid var(--border); }
.preview-tabs { display: flex; border-bottom: 1px solid var(--border); }
.preview-tabs button { flex: 1; min-width: 0; padding: 12px 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.preview-tabs button[aria-pressed="true"] { color: var(--text); background: var(--border); box-shadow: inset 0 -2px var(--cricket); }
.preview-body { flex: 1; min-height: 0; overflow: auto; padding: 10px; }
.preview-body .match-row { gap: 8px; }
.preview-body .team-line { gap: 8px; font-size: 12px; }
.preview-body .team-name { overflow-wrap: anywhere; }
.preview-footer { padding: 9px 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.widget-caption { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.widget-caption a { color: var(--accent); }
.widget-caption a:hover { text-decoration: underline; }
.cricket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 16px; align-items: start; }
.cricket-rail { grid-column: 2; grid-row: 1; }
.cricket-main { grid-column: 1; grid-row: 1; }

@media (max-width: 1100px) {
  .cricket-layout { grid-template-columns: minmax(0, 1fr); }
  .cricket-rail, .cricket-main { grid-column: auto; grid-row: auto; }
  .cricket-rail { width: 100%; max-width: 288px; justify-self: center; }
}

@media (max-width: 480px) {
  .page { padding: 12px; }
  .card { padding: 12px; }
  .topbar { padding: 14px 12px; gap: 8px; }
  .team-name { overflow-wrap: anywhere; }
  .team-score { flex-shrink: 0; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-live { background: rgba(255, 92, 92, 0.15); color: var(--danger-text); }
.badge-live .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--danger);
  animation: pulse 1.4s infinite;
}
.badge-upcoming { background: rgba(79, 140, 255, 0.15); color: var(--accent-text); }
.badge-finished { background: rgba(142, 160, 184, 0.15); color: var(--muted); }
.badge-cricket { background: rgba(47, 215, 127, 0.15); color: var(--cricket); }
.badge-tennis { background: rgba(255, 204, 51, 0.15); color: var(--tennis); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 92, 92, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(255, 92, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 92, 92, 0); }
}

.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.match-row:last-child { border-bottom: none; }
.match-row:hover { background: var(--panel-2); border-radius: 10px; }
/* Row-wide click target for rows that also hold a favorite button (see cricketRowHtml). */
div.match-row:has(.match-link), td:has(.match-link) { position: relative; }
/* The overlay that makes a whole row (or table cell) clickable is only drawn inside a positioned
   row or cell; anywhere else a link is just a link and must not stretch over the page. */
.match-row .match-link::after, .score-row .match-link::after, td .match-link::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.match-link:focus-visible { outline: none; }
.match-link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.match-row .fav-btn { position: relative; z-index: 1; }

.team-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 2px 0;
}
.team-name { font-weight: 600; }
.team-score { color: var(--muted); font-variant-numeric: tabular-nums; }

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

table.odds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.odds-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
table.odds-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--skeleton-shine) 37%, var(--panel-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.error-box {
  border: 1px dashed var(--danger);
  color: var(--danger);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
}

.mobile-nav-toggle { display: none; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 30; transition: left .2s ease; box-shadow: 0 0 0 100vmax rgba(0,0,0,0); }
  .sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.5); }
  .mobile-nav-toggle { display: inline-flex; }
}

/* Last, so it overrides the mobile sidebar transition above. */
@media (prefers-reduced-motion: reduce) {
  .badge-live .pulse, .skeleton { animation: none; }
  .sidebar { transition: none; }
}

/* Tabs, toolbars and small controls shared by the tennis detail pages. */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab-btn {
  background: var(--panel-2, var(--panel));
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn[aria-selected="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.field {
  background: var(--panel-2, var(--panel));
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
}
.stat-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.stat-row:last-child { border-bottom: none; }
.stat-row .stat-name { color: var(--muted); text-align: center; font-size: 12px; }
.stat-row .stat-home { text-align: right; font-weight: 700; }
.stat-row .stat-away { text-align: left; font-weight: 700; }
.entity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.entity img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--panel-2, var(--panel)); flex: none; }
.entity img.logo { border-radius: 6px; object-fit: contain; }
.bar-split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--border); }
.bar-split > span:first-child { background: var(--accent); }
.bar-split > span:last-child { background: var(--tennis); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2, var(--panel)); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.cal-day[disabled] { opacity: 0.35; cursor: default; }
.cal-day.has-events { border-color: var(--accent); }
.cal-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-head { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 2px; }

/* ---- Header, score strip and live-score lists ---- */

/* The old sidebar is now a slide-out menu on every screen size. */
.sidebar {
  position: fixed;
  left: -260px;
  top: 0;
  z-index: 30;
  transition: left 0.2s ease;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
}
.sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5); }
.mobile-nav-toggle,
.hdr-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
}
.mobile-nav-toggle:hover, .hdr-icon-btn:hover { background: var(--panel-2); }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

.hdr { justify-content: flex-start; gap: 14px; padding: 10px 20px; }
.hdr-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; flex: none; }
.sport-switch { display: flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; flex: none; }
.sport-pill { padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sport-pill:hover { color: var(--text); }
.sport-pill.active.sport-cricket { background: var(--cricket); color: #06210f; }
.sport-pill.active.sport-tennis { background: var(--tennis); color: #2b2200; }
.hdr-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.hdr-nav::-webkit-scrollbar { display: none; }
.hdr-link { padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.hdr-link:hover { color: var(--text); background: var(--panel-2); }
.hdr-link.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.hdr-search { margin-left: auto; position: relative; display: flex; align-items: center; flex: 0 1 240px; min-width: 120px; }
.hdr-search i { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.hdr-search-input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 8px 12px 8px 32px;
}
.hdr-search-input:focus-visible, .hdr-link:focus-visible, .sport-pill:focus-visible, .strip-card:focus-visible, .strip-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 900px) {
  .hdr { gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .hdr-brand-text { display: none; }
  .hdr-search { flex: 1 1 140px; }
  .hdr-nav { order: 10; flex: 1 0 100%; }
}

.strip { position: relative; display: flex; align-items: stretch; gap: 6px; padding: 10px 20px 4px; border-bottom: 1px solid var(--border); background: var(--panel); }
.strip[hidden] { display: none; }
/* Space is held for the strip while its first data loads, so the page below doesn't jump down when it appears. */
.strip-loading { min-height: 112px; }
@media (max-width: 480px) { .strip-loading { min-height: 107px; } }
.strip-track { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; flex: 1; min-width: 0; padding-bottom: 10px; }
.strip-track::-webkit-scrollbar { display: none; }
.strip-arrow { flex: none; align-self: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); cursor: pointer; margin-bottom: 6px; }
.strip-card { flex: 0 0 220px; scroll-snap-align: start; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.strip-card:hover { border-color: var(--accent); }
.strip-top { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); min-width: 0; }
.strip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-badge { flex: none; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.strip-badge.live { color: var(--danger-text); display: inline-flex; align-items: center; gap: 5px; }
.strip-badge.live .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }
.strip-badge.upcoming { color: var(--accent-text); }
.strip-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.strip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.strip-score { font-variant-numeric: tabular-nums; flex: none; }
.strip-note { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .strip { padding: 8px 12px 2px; } .strip-arrow { display: none; } .strip-card { flex-basis: 190px; } }
@media (prefers-reduced-motion: reduce) { .strip-badge.live .pulse { animation: none; } .strip-track { scroll-behavior: auto; } }

.group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 4px 6px; margin-top: 8px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; }
.group-head:first-child { margin-top: 0; }
.group-head a:hover { color: var(--accent); }
.group-head .small { font-weight: 500; }
.score-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); position: relative; }
.score-row:hover { background: var(--panel-2); border-radius: 10px; }
.score-row .when { font-size: 12px; color: var(--muted); font-weight: 600; }
.score-row .when.live { color: var(--danger-text); }
.score-row .players { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.score-row .player { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
.score-row .player span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-row .player.won { font-weight: 800; }
.score-row .sets { display: flex; flex-direction: column; gap: 3px; font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.score-row .sets .line { display: flex; gap: 8px; justify-content: flex-end; }
.score-row .sets .cur { font-weight: 800; }
.score-row .sets .past { color: var(--muted); }
.date-nav { display: flex; align-items: center; gap: 6px; }
@media (max-width: 480px) { .score-row { grid-template-columns: 52px minmax(0, 1fr) auto; } .score-row .fav-cell { display: none; } }
.score-row .fav-btn { position: relative; z-index: 1; }
.score-row .when.match-link { display: block; }

/* Classes that set `display` must not defeat the hidden attribute. */
[hidden] { display: none !important; }

/* ---- Match scoreboard header ---- */
.mh-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.mh-crumbs a:hover { color: var(--accent); }
.mh-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mh-meta { font-size: 13px; color: var(--muted); }
.mh-nav { display: flex; gap: 6px; }
.mh-nav .tab-btn { display: inline-flex; align-items: center; gap: 4px; }
.mh-team { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.mh-team + .mh-team { border-top: 1px solid var(--border); }
.mh-name { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; min-width: 0; }
.mh-name img.flag { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--panel-2); }
.mh-name .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-name .seed { font-size: 12px; font-weight: 600; color: var(--muted); }
.mh-team.dim .mh-name, .mh-team.dim .mh-score { color: var(--muted); }
.mh-score { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mh-score .ov { font-size: 13px; font-weight: 500; color: var(--muted); margin-right: 6px; }
.mh-score .and { color: var(--muted); font-weight: 600; margin: 0 4px; }
.mh-status { margin: 12px 0 0; font-weight: 700; font-size: 15px; }
.mh-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.mh-live-note { font-size: 11px; color: var(--muted); margin-top: 8px; }
.set-board { width: 100%; border-collapse: collapse; }
.set-board td, .set-board th { padding: 8px 6px; text-align: center; font-variant-numeric: tabular-nums; font-size: 18px; }
.set-board th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.set-board td.who { text-align: left; width: 100%; }
.set-board td.sets { font-weight: 800; font-size: 22px; }
.set-board td.past { color: var(--muted); }
.set-board td.cur-set { font-weight: 800; }
.set-board td.game { font-weight: 800; color: var(--tennis); }
.set-board tr + tr td { border-top: 1px solid var(--border); }
.set-board .winner .mh-name { color: var(--text); }
.set-board .loser .mh-name { color: var(--muted); }
@media (max-width: 480px) { .mh-name { font-size: 17px; } .mh-score { font-size: 19px; } .set-board td { padding: 8px 3px; font-size: 16px; } .mh-name img.flag { width: 26px; height: 26px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- Home page ---- */
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.home-main, .home-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home-main > .grid { margin: 0; }
@media (max-width: 1000px) { .home-layout { grid-template-columns: minmax(0, 1fr); } }
.card-title.with-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title.with-link .see-all { font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--accent-text); }
.card-title.with-link .see-all:hover { text-decoration: underline; }
.feat { display: block; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; min-width: 0; }
.feat:hover { border-color: var(--accent); }
.feat .mh-name { font-size: 17px; }
.feat .mh-score { font-size: 19px; }
.feat .mh-name img.flag { width: 24px; height: 24px; }
.feat .mh-top { margin-bottom: 8px; }
.feat .open { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--accent-text); }
.rail-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.rail-row:last-child { border-bottom: none; }
.rail-row:hover { background: var(--panel-2); border-radius: 8px; }
.rail-row .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-row .tag { flex: none; }
.home-main .score-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
.home-main .score-row .fav-cell { display: none; }

/* ---- Phone: bottom tab bar, swipeable chip rows, roomier tap targets ---- */
.tabbar { display: none; }

@media (max-width: 900px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar-item {
    flex: 1;
    min-width: 0;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
  }
  .tabbar-item i { font-size: 22px; }
  .tabbar-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar-item.active { color: var(--accent-text); }
  .tabbar-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

  .mobile-nav-toggle, .hdr-icon-btn { width: 40px; height: 40px; }
  .tab-btn { min-height: 38px; display: inline-flex; align-items: center; }
  .field { min-height: 40px; }
  .hdr-link { padding: 10px 12px; }
  .nav-item { padding: 12px; }
}

@media (max-width: 700px) {
  /* Chip rows swipe sideways instead of wrapping into several lines. */
  .tabs, .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-left: -2px;
    padding-bottom: 2px;
  }
  .tabs::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
  .tabs .tab-btn, .chips .tab-btn { flex: none; white-space: nowrap; scroll-snap-align: start; }

  /* Wide tables scroll inside their card rather than stretching the page. */
  table.odds-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.odds-table td, table.odds-table th { white-space: nowrap; }
}

@media (max-width: 900px) {
  /* Bigger hit areas that don't change the visual layout. */
  .sport-pill { padding: 10px 18px; }
  .hdr-brand { min-height: 40px; }
  .card-title.with-link .see-all { padding: 12px 8px; margin: -12px -8px; }
  .fav-btn { min-width: 40px; min-height: 40px; margin: -10px -6px; }
}
@media (max-width: 900px) { .mh-crumbs a { padding: 12px 2px; margin: -12px -2px; } }

/* Player statistics tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.stat-tile { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.stat-value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.clip-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; }
.clip-link:hover { text-decoration: underline; }

/* ---- Footer and no-JavaScript notice ---- */
.site-footer { margin: 8px 24px 24px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 16px; }
.site-footer a { padding: 6px 0; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.noscript-note { margin: 0; padding: 14px 18px; background: var(--panel); border-bottom: 1px solid var(--border); font-size: 14px; text-align: center; }
@media (max-width: 480px) { .site-footer { margin: 8px 12px 16px; } }

/* Match rows inside two-column cards get the compact layout (no star column) so names fit. */
.grid-2 .score-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
.grid-2 .score-row .fav-cell { display: none; }

/* ---- Small pictures: avatars, logos and flags ---- */
.av {
  --s: 24px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
  vertical-align: middle;
  font-size: calc(var(--s) * 0.38);
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  user-select: none;
}
.av .ini { letter-spacing: 0.02em; }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Tournament logos are not round and should not be cropped. */
.av.sq { border-radius: 6px; background: #fff; border-color: transparent; }
.av.sq img { object-fit: contain; padding: 2px; }
.av.sq .ini { color: #5c6b7f; }
.fl {
  flex: none;
  width: 18px;
  height: 13px;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(128, 144, 170, 0.35);
}
/* Pictures sitting inline in running rows. */
.rail-row .label .av, .rail-row .label .fl { margin-right: 6px; }
.strip-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.strip-name .strip-ico, .strip-name .av, .strip-name .fl { flex: none; }
.strip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.entity .av, .player .av { flex: none; }
.mh-name .av { flex: none; }
.mh-name .fl { width: 22px; height: 16px; }

/* ---- Sponsor banners ---- */
.ad-slot { margin: 0 auto; max-width: 100%; text-align: center; }
.ad-label { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
/* The box keeps the banner's proportions while the image loads, so the page does not jump. */
.ad-link { display: block; width: min(100%, var(--w)); aspect-ratio: var(--ar); margin: 0 auto; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); }
.ad-link:hover { border-color: var(--accent); }
.ad-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ad-link picture, .ad-link img { display: block; width: 100%; height: 100%; }
.ad-link img { object-fit: contain; }
@media (max-width: 640px) { .ad-link { width: min(100%, var(--wm, var(--w))); aspect-ratio: var(--arm, var(--ar)); } }
.ad-top { max-width: 1200px; padding: 16px 24px 0; }
.ad-inline { margin: 14px 0; }
@media (max-width: 480px) { .ad-top { padding: 12px 12px 0; } }

/* Short introduction under a page's (visually hidden) main heading; also gives crawlers real text. */
.page-intro { margin: 0 0 14px; max-width: 70ch; }
.about-card p { margin: 0 0 10px; line-height: 1.6; color: var(--muted); }
.about-card p:last-child { margin-bottom: 0; }
.about-title { margin: 0 0 10px; font-size: 18px; }

/* Light theme: the bright badge colours are for dark backgrounds; these darker ones keep the text readable. */
:root[data-theme="light"] .badge-cricket { color: #0a6b3a; }
:root[data-theme="light"] .badge-tennis { color: #7a5600; }

/* ---- Today's matches ---- */
.today-title { margin: 0 0 4px; font-size: 24px; line-height: 1.25; }
.today-date { margin: 0 0 10px; }
.today-intro { margin: 0; max-width: 75ch; line-height: 1.6; color: var(--muted); }
.today-h { margin: 18px 0 6px; font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.today-h:first-of-type { margin-top: 4px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; }

/* ---- Cookie consent banner ---- */
.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); }
.consent p { margin: 0; flex: 1 1 280px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.consent a { color: var(--accent-text); text-decoration: underline; }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }
.consent-accept { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
@media (max-width: 900px) { .consent { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } } /* clears the phone tab bar */
.footer-link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; }
