/* Styles owned by the extras agent. Loaded after style.css, so rules here win.
   Covers: vFootball, Jackpot, Promotions, Results pages and the Games lobby extras. */

.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;
}

/* ===== Shared: page header, filter chips, tabs, cards ===== */
.xp-top { padding-bottom: 0; }
.xp-top .help-link .icon { width: 22px; height: 22px; }
.xp-top .xp-chips { padding: 0 16px 12px; }

.xp-chips { display: flex; gap: 8px; }
.xp-chip {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  background: transparent;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}
.xp-chip.on { background: #fff; border-color: #fff; color: var(--ink); }
.xp-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.xp-tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.xp-tab {
  flex: 1 0 auto;
  padding: 12px 10px;
  border: none;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.xp-tab.on { color: var(--text); border-bottom-color: var(--green); }
.xp-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.xp-body { padding: 12px 16px 24px; display: grid; gap: 12px; }
.xp-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 0; }
.xp-h { font-size: 1.05rem; margin: 4px 0 10px; }
.xp-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.xp-table th, .xp-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.xp-table th { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.xp-rules { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 6px; }

/* ===== vFootball ===== */
.v-status { gap: 12px; padding-top: 0; }
.v-leagues { display: flex; gap: 8px; margin: 0 -16px; padding: 12px 16px 0; background: var(--ink); }
.v-league {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.v-league.on { background: var(--card); color: var(--text); }
.v-league:focus-visible, .v-tab:focus-visible, .v-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.v-tabs { display: flex; gap: 6px; background: var(--bg); padding: 4px; border-radius: 10px; }
.v-tab { flex: 1; padding: 8px 6px; border: none; border-radius: 8px; background: none; color: var(--muted); font-weight: 700; }
.v-tab.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(15, 42, 61, 0.15); }

.v-schedule { display: flex; gap: 8px; }
.v-chip {
  flex: 0 0 auto;
  display: grid;
  gap: 1px;
  min-width: 84px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  text-align: left;
}
.v-chip strong { font-size: 0.9rem; }
.v-chip small { color: var(--muted); font-variant-numeric: tabular-nums; }
.v-chip.live small { color: var(--red); font-weight: 800; }
.v-chip.on { border-color: var(--green); background: var(--green); color: #fff; }
.v-chip.on small { color: #d9eefa; }

.v-note { margin: 0; padding: 10px 16px; color: var(--muted); font-size: 0.85rem; }
.v-fixtures { display: grid; }
.v-fix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}
.v-fix-teams, .v-res-teams { display: grid; gap: 4px; min-width: 0; }
.v-fix-teams span, .v-res-teams span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-fix-odds { display: flex; gap: 4px; }
.v-fix-odds span {
  display: grid;
  justify-items: center;
  min-width: 48px;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.v-fix-odds small { font-size: 0.7rem; font-weight: 600; }

.v-events { list-style: none; margin: 0; padding: 0 16px 16px; display: grid; gap: 6px; }
.v-events li {
  display: grid;
  grid-template-columns: 36px auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.v-events b { font-variant-numeric: tabular-nums; color: var(--green); }
.v-events span:last-child { display: grid; min-width: 0; }
.v-events small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-goal { padding: 2px 6px; border-radius: 4px; background: var(--win); color: #fff; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px; }
@media (prefers-reduced-motion: no-preference) {
  .v-events li:first-child { animation: v-pop 0.4s ease-out; }
}
@keyframes v-pop { from { background: rgba(22, 163, 74, 0.18); } to { background: transparent; } }

.v-table-wrap { overflow-x: auto; padding: 0 8px 4px; }
.v-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.v-table th, .v-table td { padding: 7px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.v-table thead th { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.v-table .t-team { text-align: left; font-weight: 600; }
.v-table th.t-team { display: flex; align-items: center; gap: 6px; min-width: 0; }
.v-table th.t-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.v-table tr.top td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.v-table tr.bottom td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.t-form span { display: inline-grid; place-items: center; width: 16px; height: 16px; margin: 0 1px; border-radius: 3px; color: #fff; font-size: 0.6rem; font-weight: 800; }
.form-W { background: var(--win); }
.form-D { background: #94a3b8; }
.form-L { background: var(--red); }
.v-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
@media (max-width: 440px) {
  .v-table .t-form { display: none; }
  .v-table th.t-team span { max-width: 110px; }
}

/* ===== Jackpot page ===== */
.jp-hero {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 18px 16px;
  background: linear-gradient(150deg, var(--purple-deep), var(--purple) 70%);
  color: #fff;
  text-align: center;
}
.jp-hero small { color: #e4d9ff; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.jp-hero strong { color: var(--gold); font-size: 2.2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.jp-hero span { color: #efe9ff; font-size: 0.9rem; }
.jp-hero b { font-variant-numeric: tabular-nums; }
.jp-tiers { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.jp-tiers span { display: grid; padding: 4px 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); font-size: 0.75rem; }
.jp-tiers b { color: #fff; font-size: 0.85rem; }

.jp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.jp-quick { display: inline-flex; align-items: center; gap: 4px; background: var(--purple); border-color: var(--purple); color: #fff; }
.jp-quick:hover { background: var(--purple-deep); border-color: var(--purple-deep); }
.jp-tools .icon.sm { width: 16px; height: 16px; }
.jp-tip { color: var(--muted); font-size: 0.8rem; }

.jp-table { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.jp-line {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) repeat(3, 48px);
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.jp-line:last-child { border-bottom: none; }
.jp-head { padding: 6px 10px; background: var(--bg); color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.jp-head span:nth-child(n+3) { text-align: center; }
.jp-no { color: var(--muted); font-weight: 700; text-align: center; }
.jp-match { display: grid; min-width: 0; }
.jp-match strong, .jp-match small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jp-match strong { font-size: 0.9rem; }
.jp-match small { color: var(--muted); font-size: 0.75rem; }
.jp-cell {
  display: grid;
  justify-items: center;
  height: 42px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-weight: 800;
  line-height: 1.1;
}
.jp-cell small { color: var(--muted); font-size: 0.68rem; font-weight: 600; }
.jp-cell.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.jp-cell.on small { color: #e4d9ff; }
.jp-cell:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.jp-summary {
  position: sticky;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 2;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 -4px 12px rgba(15, 42, 61, 0.1);
}
.jp-sum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.jp-sum-grid span { display: grid; color: var(--muted); font-size: 0.8rem; }
.jp-sum-grid strong { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.jp-summary .message { margin: 0; text-align: center; }
.jp-summary .message:empty { display: none; }

.jp-draw-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.jp-draw-head span { color: var(--muted); font-size: 0.85rem; }
.jp-codes { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.jp-code { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 4px; font-size: 0.8rem; font-weight: 800; color: #fff; }
.jp-code.c1 { background: var(--green); }
.jp-code.cX { background: #94a3b8; }
.jp-code.c2 { background: var(--purple); }
.xp-details summary { cursor: pointer; color: var(--green); font-weight: 600; }
.xp-details summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.jp-games { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.jp-games li span:first-child { display: inline-block; min-width: 0; }
.jp-games li { font-size: 0.9rem; }
.jp-games li b { margin: 0 8px; font-variant-numeric: tabular-nums; }
.tier-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--purple-soft); color: var(--purple-deep); font-weight: 800; }
.tier-badge.t0 { background: var(--gold); color: #111; }
.jp-status { font-weight: 700; white-space: nowrap; }
.jp-status.won { color: var(--win); }
.jp-status.lost { color: var(--red); }
.jp-status.pending { color: var(--green); }
.jp-page-link { display: block; margin: 0 0 12px; color: var(--green); font-weight: 600; text-decoration: none; }
.jp-page-link:hover { text-decoration: underline; }

/* ===== Promotions page ===== */
.xp-promo { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.xp-promo-banner { display: flex; align-items: center; gap: 14px; padding: 14px; color: #fff; }
.xp-promo-art { flex: 0 0 72px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.xp-promo-title { display: grid; gap: 2px; }
.xp-promo-title small { justify-self: start; padding: 1px 8px; border-radius: 3px; background: var(--gold); color: #111; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.xp-promo-title strong {
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 1.6rem;
  font-style: italic;
  line-height: 1;
  text-transform: uppercase;
}
.xp-promo-body { display: grid; gap: 8px; padding: 12px 14px 14px; }
.xp-promo-body p { margin: 0; }
.xp-promo-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; }
.xp-promo-meta .icon { width: 16px; height: 16px; }
.xp-promo-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.xp-terms { padding: 10px 12px; border-radius: 8px; background: var(--bg); font-size: 0.9rem; }
.xp-terms h3 { margin: 0 0 6px; font-size: 0.95rem; }
.xp-terms ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* ===== Results page ===== */
.xp-res-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 16px 0; }
.xp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
}
.xp-search:focus-within, .xp-select:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
.xp-search .icon { width: 18px; height: 18px; flex-shrink: 0; }
.xp-search input { flex: 1; min-width: 0; padding: 10px 0; border: none; outline: none; background: transparent; font: inherit; color: var(--text); }
.xp-select select {
  height: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  outline: none;
}
.xp-res-group { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.xp-res-league { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.xp-res-league h2 { font-size: 0.95rem; }
.xp-res-league span { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.xp-res-list { list-style: none; margin: 0; padding: 0; }
.xp-res-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.xp-res-list li:last-child { border-bottom: none; }
.xp-res-ft { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.xp-res-teams { display: grid; gap: 4px; min-width: 0; }
.xp-res-teams span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.xp-res-teams span.win { color: var(--text); font-weight: 700; }
.xp-res-score { display: grid; gap: 4px; justify-items: end; font-variant-numeric: tabular-nums; color: var(--muted); }
.xp-res-score b.win { color: var(--text); }
.xp-more { justify-self: center; color: var(--green); font-weight: 600; }

/* ===== Games lobby extras ===== */
.gh-tools.gh-tools-one { grid-template-columns: 1fr; }
.gh-cats { display: flex; gap: 8px; padding: 12px 16px 0; }
.gh-cat {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  font-weight: 600;
  white-space: nowrap;
}
.gh-cat small { padding: 0 6px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 0.72rem; }
.gh-cat .icon.sm { width: 16px; height: 16px; }
.gh-cat.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.gh-cat.on small { background: rgba(255, 255, 255, 0.2); color: #fff; }
.gh-cat:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gh-row-head { display: flex; justify-content: space-between; align-items: baseline; padding-right: 16px; }
.gh-row-head .link-btn { color: var(--purple); font-weight: 600; text-decoration: none; }
.gh-row { display: flex; gap: 10px; padding: 0 16px 4px; }
.gh-row .gtile-wrap { flex: 0 0 110px; }
.gh-row .gt-title { font-size: 1rem; }
.gtag {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--gold);
  color: #111;
  font-size: 0.62rem;
  font-weight: 800;
  pointer-events: none;
}

/* ===== Dark mode touches ===== */
.theme-dark .xp-chip.on { color: var(--ink-deep); }
.theme-dark .v-fix-odds span, .theme-dark .jp-cell:not(.on) { background: #183549; }
.theme-dark .jp-head, .theme-dark .xp-res-league { background: #0f2233; }
.theme-dark .form-D, .theme-dark .jp-code.cX { background: #64748b; }
.theme-dark .tier-badge:not(.t0) { color: #e4d9ff; }

/* The pages keep a tidy width on big screens */
@media (min-width: 1024px) {
  .jp-summary { bottom: 12px; }
}

/* ===== Phones and tablets ===== */
@media (max-width: 1023px) {
  /* Chips tall enough to tap */
  .xp-chip, .gh-cat, .v-league, .v-tab { min-height: 38px; }
  /* The jackpot has its own submit bar at the bottom: the floating bet slip button would cover it */
  html[data-view="jackpot"] .slip-fab { display: none; }
}
/* Narrow phones: the league menu on Results leaves room for the search box */
@media (max-width: 440px) {
  .xp-select select { max-width: 42vw; }
}
