/* Styles owned by the sports agent. Loaded after style.css, so rules here win.
   Sports menu, match rows, Live Betting page, sport/league pages, match page extras. */

/* ===== Match rows: time + ID + league line across the top ===== */
.row { row-gap: 2px; }
.row > .row-meta {
  grid-column: 1 / -1;
  align-items: center;
  margin-bottom: 0;
  min-width: 0;
}
.row-id { font-variant-numeric: tabular-nums; opacity: 0.85; }
.row-league { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Favourite star */
.fav-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--meta, var(--muted));
}
.fav-btn:hover { color: var(--gold); }
.fav-btn.on { color: var(--gold); }
.fav-btn.on .icon { fill: currentColor; }
.fav-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Date and league headings inside lists */
.day-head {
  padding: 8px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.league-sub {
  padding: 7px 16px;
  background: var(--head-bg, #f2f8fc);
  color: var(--meta, var(--muted));
  font-size: 0.8rem;
  font-weight: 700;
  border-bottom: 1px solid var(--row-line, var(--line));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pulsing dot for live things */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--win);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
  animation: live-pulse 1.6s infinite;
  flex-shrink: 0;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ===== A-Z menu additions ===== */
.az-sport { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.az-sport small { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.az-country {
  padding: 10px 16px 4px 22px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.az-live-open {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  color: var(--green);
  font-weight: 700;
  text-align: left;
}
.az-live-open span { margin-right: auto; }
.az-sport:focus-visible, .az-league:focus-visible, .az-live-open:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* ===== Live Betting and sport/league pages ===== */
.sp-top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ink);
  border-bottom: 2px solid var(--gold);
  color: #fff;
}
.sp-top h1 {
  margin: 0;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-total { display: flex; align-items: center; font-size: 0.85rem; font-weight: 600; opacity: 0.9; white-space: nowrap; }
.sp-crumbs { margin: 0; padding: 8px 16px 0; color: var(--muted); font-size: 0.8rem; background: var(--card); }

.sp-chips { display: flex; gap: 8px; padding: 10px 16px; background: var(--card); }
.sp-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.sp-chip small { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.sp-chip.on small { color: #d6ecf9; }

.sp-days {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 16px 10px;
  background: var(--card);
}
.sp-day {
  padding: 5px 12px;
  border: none;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}
.sp-day.on { background: var(--ink); color: #fff; }
.sp-live-link {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
  color: var(--text);
  font-weight: 700;
}
.sp-markets { background: var(--card); }
.sp-list { background: var(--card); }
.sp-block + .sp-block { border-top: 8px solid var(--bg); }
.sp-block-head {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 12px 16px;
  font-size: 1.1rem;
}
.sp-block-head small { margin-left: auto; color: var(--muted); font-size: 0.8rem; font-weight: 600; }

.sp-chip:focus-visible, .sp-day:focus-visible, .sp-live-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ===== Match page extras ===== */
/* Market group tabs stay visible while scrolling through the markets */
.mp-tabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 52px); z-index: 25; }
.mp-tabs button small { margin-left: 2px; opacity: 0.7; font-size: 0.78rem; }
.mp-tabs button:focus-visible, .mp-card-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.mp-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Live match tracker */
.mp-tracker { padding: 12px 16px 10px; background: var(--ink-deep); color: #eaf5fc; }
.trk-bar {
  position: relative;
  height: 8px;
  margin: 8px 0 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
}
.trk-fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--aqua); }
.trk-ht { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: rgba(255, 255, 255, 0.6); }
.trk-goal {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid var(--ink-deep);
  border-radius: 50%;
  background: var(--gold);
}
.trk-goal.a { background: #fff; }
.trk-labels { display: flex; justify-content: space-between; font-size: 0.72rem; opacity: 0.75; }
.trk-events { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 120px; overflow-y: auto; }
.trk-events li { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.trk-events li b { min-width: 30px; font-variant-numeric: tabular-nums; color: var(--gold); }
.trk-events li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk-events li strong { font-variant-numeric: tabular-nums; }
.trk-events li.none { opacity: 0.75; }
.trk-note { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.9rem; }

/* Stats tab */
.mp-stats { display: grid; gap: 10px; padding: 12px; }
.st-demo {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7db;
  color: #7a5a00;
  font-size: 0.85rem;
  font-weight: 600;
}
.st-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.st-card h3 { margin: 0 0 10px; font-size: 0.95rem; }
.st-bar { display: flex; height: 10px; gap: 2px; border-radius: 5px; overflow: hidden; }
.st-bar .h { background: var(--green); }
.st-bar .d { background: #9aa7b4; }
.st-bar .a { background: var(--gold); }
.st-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 0.8rem; color: var(--muted); }
.st-xg { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; }
.st-xg strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.st-xg span { color: var(--muted); font-size: 0.8rem; }
.st-pos { display: grid; gap: 6px; }
.st-pos div { display: flex; align-items: center; gap: 8px; }
.st-pos span:not(.crest) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-pos strong { font-variant-numeric: tabular-nums; }
.st-pos strong::before { content: "#"; color: var(--muted); font-weight: 400; }
.st-form { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.st-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.st-team span:not(.crest) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-badges { display: flex; gap: 4px; flex-shrink: 0; }
.st-badges b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: #fff;
  font-size: 0.75rem;
}
.st-badges .f-W { background: var(--win); }
.st-badges .f-D { background: #8a97a4; }
.st-badges .f-L { background: var(--red); }
.st-h2h { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.st-h2h li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.st-h2h li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-h2h li span:last-of-type { text-align: right; }
.st-h2h li strong { font-variant-numeric: tabular-nums; }
.st-h2h li small { grid-column: 1 / -1; color: var(--muted); font-size: 0.75rem; text-align: center; margin-top: -4px; }

/* ===== Desktop left sports menu ===== */
.dl { background: var(--card); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.dl-title {
  margin: 0;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.dl-list, .dl-countries, .dl-leagues { margin: 0; padding: 0; list-style: none; }
.dl-item, .dl-sport, .dl-country, .dl-league {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  text-align: left;
  font-size: 0.9rem;
}
.dl-item span, .dl-sport span, .dl-country span, .dl-league span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-item small, .dl-sport small, .dl-country small, .dl-league small { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.dl-item .live-dot { flex: 0 0 8px; margin: 0 4px; }
.dl-sport { font-weight: 700; }
.dl-country { padding-left: 24px; background: var(--bg); }
.dl-country.all { color: var(--green); font-weight: 600; }
.dl-league { padding-left: 36px; font-size: 0.85rem; }
.dl-item:hover, .dl-sport:hover, .dl-country:hover, .dl-league:hover { color: var(--green); }
.dl-item.active, .dl-country.active, .dl-league.active {
  color: var(--green);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--green);
}
.dl-item:focus-visible, .dl-sport:focus-visible, .dl-country:focus-visible, .dl-league:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Desktop: pages sit under the big header */
@media (min-width: 1024px) {
  .sp-top { top: var(--desk-head-h, 108px); }
  .mp-tabs { top: calc(var(--desk-head-h, 108px) + 52px); }
}

/* ===== Small phones ===== */
@media (max-width: 420px) {
  .sp-top h1 { font-size: 1.3rem; }
}

/* ===== Dark mode ===== */
.theme-dark .day-head { background: #0b3552; }
.theme-dark .st-demo { background: #3a3210; color: #ffd98a; }
.theme-dark .dl-title { background: #0b3552; }
.theme-dark .sp-day { background: #183549; }
.theme-dark .sp-day.on { background: var(--green); }

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* ===== Phones and tablets: easier taps on stars and market tabs ===== */
@media (max-width: 1023px) {
  .fav-btn { position: relative; }
  .fav-btn::after { content: ""; position: absolute; inset: -8px -6px; }
  .mp-tabs button, .sp-chip, .sp-live-link { min-height: 38px; }
  .sp-day { min-height: 36px; }
}
/* Narrow phones: odds boxes keep their labels inside */
@media (max-width: 360px) {
  .mp-markets { padding-inline: 8px; }
  .mp-odd { padding-inline: 8px; font-size: 0.8rem; }
}
