/* ==========================================================================
   PLIXWIN – Home page "Top matches" row
   ========================================================================== */
.spx { display: none; }
html[data-theme="teal"] body.home-mode .spx:not([hidden]) { display: block; margin: 4px 0 28px; font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; }

/* ---------- head ---------- */
.spx-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.spx-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: #FFFFFF; }
.spx-title .tl-duo { width: 26px !important; height: 26px !important; }
.spx-live-count {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px;
  background: rgba(255, 74, 85, .14); color: #FF6B74; font-style: normal; font-size: 12px; font-weight: 800;
}
.spx-live-count::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #FF4A55; animation: spxPulse 1.6s ease-in-out infinite; }
.spx-live-count[hidden] { display: none; }
.spx-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.spx-all, .spx-arrow {
  height: 36px; border: 0; border-radius: 10px; background: #061A24; color: #FFFFFF; cursor: pointer;
  font: 700 13px/1 'Manrope', system-ui, sans-serif; transition: background .15s, opacity .15s;
}
.spx-all { padding: 0 14px; }
.spx-arrow { width: 36px; display: grid; place-items: center; }
.spx-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.spx-all:hover, .spx-arrow:hover { background: #0D2937; }
.spx-arrow:disabled { opacity: .35; cursor: default; background: #061A24; }

/* ---------- row ---------- */
.spx-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 28px) / 3); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.spx-track::-webkit-scrollbar { display: none; }

/* ---------- card ---------- */
.spx-card {
  --c1: #22333F; --c2: #121C24;
  position: relative; isolation: isolate; overflow: hidden; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 14px 12px; border-radius: 16px; cursor: pointer;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .10), transparent 55%), linear-gradient(140deg, var(--c1), var(--c2));
  color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); transition: transform .18s ease, box-shadow .18s ease;
}
.spx-card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 10px 24px rgba(0, 0, 0, .3); }
.spx-card:focus-visible { outline: 2px solid #00B175; outline-offset: 2px; }
.spx-card.is-soccer { --c1: #0F6B47; --c2: #07301F; }
.spx-card.is-cricket { --c1: #0E5F6E; --c2: #072A31; }
.spx-card.is-tennis { --c1: #6E5A17; --c2: #2D250A; }
.spx-card.is-basketball { --c1: #7A3A14; --c2: #2F1608; }
.spx-card.is-hockey { --c1: #1A4D86; --c2: #0A1E36; }
.spx-card.is-afootball { --c1: #6E2323; --c2: #2B0D0D; }
.spx-card.is-volleyball { --c1: #13617A; --c2: #082933; }
.spx-card.is-baseball { --c1: #6E2337; --c2: #2B0D16; }
.spx-card.is-mma { --c1: #5C2A1E; --c2: #24100B; }
.spx-card.is-esports { --c1: #5B2394; --c2: #230E3B; }
/* the sport's photo, faint, behind the card (tinted by the card colour) */
.spx-bg {
  position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 12%; opacity: .2; mix-blend-mode: luminosity; pointer-events: none;
  -webkit-mask-image: radial-gradient(60% 85% at 50% 22%, #000 25%, transparent 78%);
          mask-image: radial-gradient(60% 85% at 50% 22%, #000 25%, transparent 78%);
  transition: opacity .2s ease, transform .35s ease;
}
.spx-card:hover .spx-bg { opacity: .28; transform: scale(1.03); }

.spx-top { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .78); }
.spx-sport { width: 15px; height: 15px; flex: none; color: rgba(255, 255, 255, .85); }
.spx-league { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spx-time { margin-left: auto; flex: none; color: #FFFFFF; font-weight: 800; }
.spx-live { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; background: #E5484D; color: #FFFFFF; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.spx-live i { width: 6px; height: 6px; border-radius: 50%; background: #FFFFFF; animation: spxPulse 1.6s ease-in-out infinite; }
@keyframes spxPulse { 50% { opacity: .35; } }

.spx-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 8px; margin-top: 4px; }
.spx-team { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.spx-team.is-away { align-items: flex-end; text-align: right; }
.spx-team strong { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14.5px; line-height: 1.25; font-weight: 800; min-height: 2.5em; display: -webkit-box; align-content: end; }
.spx-crest { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden; background: rgba(255, 255, 255, .1); }
.spx-crest img { width: 100%; height: 100%; object-fit: contain; }
.spx-crest img[src*="flags_by_code"] { object-fit: cover; }
.spx-crest.is-icon { background: rgba(255, 255, 255, .12); }
.spx-crest-ic { width: 55%; height: 55%; color: rgba(255, 255, 255, .7); stroke-width: 1.8; }
.spx-vs { align-self: start; margin-top: 11px; color: rgba(255, 255, 255, .5); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.spx-score { align-self: start; margin-top: 4px; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.spx-score b { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); font-size: 14px; font-weight: 800; }
.spx-score i { font-style: normal; color: rgba(255, 255, 255, .6); font-weight: 800; }

.spx-market { margin: 2px 0 0; text-align: center; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .62); }
.spx-odds { display: flex; gap: 8px; }
.spx-odd {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 0; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: rgba(255, 255, 255, .13); color: #FFFFFF; font-family: inherit; transition: background .15s;
}
.spx-odd span { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .7); }
.spx-odd b { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.spx-odd:hover { background: rgba(255, 255, 255, .22); }
.spx-more {
  flex: none; width: 42px; height: 42px; border: 0; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
  background: rgba(255, 255, 255, .13); color: #FFFFFF; transition: background .15s;
}
.spx-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.spx-more:hover { background: rgba(255, 255, 255, .22); }
.spx-more:focus-visible { outline: 2px solid #00B175; outline-offset: 2px; }
.spx-odd.is-up { animation: spxUp 2.4s ease; }
.spx-odd.is-down { animation: spxDown 2.4s ease; }
@keyframes spxUp { 0%, 60% { background: rgba(0, 196, 130, .45); } }
@keyframes spxDown { 0%, 60% { background: rgba(229, 72, 77, .45); } }

/* ---------- smaller screens ---------- */
@media (max-width: 1200px) { .spx-track { grid-auto-columns: calc((100% - 14px) / 2); } }
@media (max-width: 700px) {
  html[data-theme="teal"] body.home-mode .spx:not([hidden]) { margin: 0 0 22px; }
  .spx-head { margin-bottom: 10px; }
  .spx-title { font-size: 18px; }
  .spx-title .tl-duo { width: 23px !important; height: 23px !important; }
  .spx-arrow { display: none; }
  .spx-all { height: 32px; padding: 0 12px; font-size: 12.5px; }
  .spx-track { grid-auto-columns: 86%; gap: 10px; }
  .spx-card { padding: 12px 12px 10px; gap: 8px; border-radius: 14px; }
  .spx-team strong { font-size: 13.5px; }
  .spx-score b { min-width: 26px; height: 28px; font-size: 13px; padding: 0 5px; }
  .spx-crest { width: 32px; height: 32px; }
  .spx-odd { height: 40px; padding: 0 10px; }
  .spx-more { width: 40px; height: 40px; }
}

/* real team logos sit on the card without a circle, like the sportsbook */
.spx-crest:has(img[src*="/competitors/"]) { background: none; border-radius: 0; overflow: visible; }

/* ==========================================================================
   "All bets" sheet (arrow on a match card): bottom sheet on phones, window on desktop
   ========================================================================== */
html.spm-lock, html.spm-lock body { overflow: hidden !important; }
.spm { position: fixed; inset: 0; z-index: 2147483000; font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; color: #FFFFFF; }
.spm[hidden] { display: none; }
.spm-back { position: absolute; inset: 0; background: rgba(0, 6, 10, .72); opacity: 0; transition: opacity .2s ease; }
.spm.is-open .spm-back { opacity: 1; }
.spm-panel {
  position: absolute; left: 50%; top: 50%; width: min(680px, calc(100vw - 32px)); max-height: min(84vh, 820px);
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: #061A24;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 30px 80px rgba(0, 0, 0, .6);
  transform: translate(-50%, -46%); opacity: 0; transition: transform .22s ease, opacity .2s ease;
}
.spm.is-open .spm-panel { transform: translate(-50%, -50%); opacity: 1; }
.spm-grip { display: none; }
.spm-head { padding: 16px 18px 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); background: #08202C; }
.spm-meta { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .62); }
.spm-league { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spm-status { flex: none; color: #FFFFFF; font-weight: 800; }
.spm-status .spx-live { margin: 0; }
.spm-x { margin-left: auto; flex: none; width: 34px; height: 34px; border: 0; border-radius: 10px; display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, .08); color: #FFFFFF; }
.spm-x:hover { background: rgba(255, 255, 255, .14); }
.spm-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.spm-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; margin: 10px 0 0; font-size: 16px; font-weight: 800; line-height: 1.25; }
.spm-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.spm-team > span:not(.spx-crest) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spm-team.is-away { justify-content: flex-end; text-align: right; }
.spm-team .spx-crest { width: 32px; height: 32px; }
.spm-vs { color: rgba(255, 255, 255, .45); font-size: 12px; text-transform: uppercase; }
.spm-score { padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, .1); font-variant-numeric: tabular-nums; white-space: nowrap; }

.spm-tabs { display: flex; gap: 8px; padding: 12px 18px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.spm-tabs::-webkit-scrollbar { display: none; }
.spm-tabs[hidden] { display: none; }
.spm-tabs button {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border: 0; border-radius: 99px; cursor: pointer;
  background: #0D2937; color: rgba(255, 255, 255, .75); font: 700 13px/1 'Manrope', system-ui, sans-serif; transition: background .15s, color .15s;
}
.spm-tabs button small { font-size: 11px; font-weight: 800; color: rgba(255, 255, 255, .45); }
.spm-tabs button:not(.is-on):hover { background: #123444; color: #FFFFFF; }
.spm-tabs button.is-on { background: #00B175; color: #00140C; }
.spm-tabs button.is-on small { color: rgba(0, 20, 12, .6); }

.spm-body { flex: 1 1 auto; min-height: 160px; overflow-y: auto; overscroll-behavior: contain; padding: 6px 18px 14px; -webkit-overflow-scrolling: touch; outline: none; }
.spm-mkt { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.spm-mkt:last-child { border-bottom: 0; }
.spm-mkt h4 { margin: 0 0 9px; font-size: 13.5px; font-weight: 700; color: rgba(255, 255, 255, .85); line-height: 1.35; }
.spm-row { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 8px; }
.spm-row + .spm-row { margin-top: 8px; }
.spm-row.is-many { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.spm-odd {
  min-width: 0; height: 44px; padding: 0 12px; border: 0; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #0D2937; color: #FFFFFF; font-family: inherit; transition: background .15s;
}
.spm-odd span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .72); }
.spm-odd b { flex: none; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; color: #FFFFFF; }
.spm-odd:hover { background: #123444; }
.spm-odd:hover b { color: #00D68F; }
.spm-odd:focus-visible, .spm-tabs button:focus-visible, .spm-open:focus-visible { outline: 2px solid #00B175; outline-offset: 2px; }
.spm-odd.is-up { animation: spxUp 2.4s ease; }
.spm-odd.is-down { animation: spxDown 2.4s ease; }

.spm-wait { display: grid; gap: 10px; padding: 12px 0; }
.spm-wait i { display: block; height: 70px; border-radius: 12px; background: linear-gradient(110deg, #0A2330 30%, #0F2E3D 50%, #0A2330 70%); background-size: 220% 100%; animation: spmWait 1.3s linear infinite; }
@keyframes spmWait { to { background-position: -220% 0; } }
.spm-empty { display: grid; justify-items: center; gap: 14px; padding: 40px 10px; text-align: center; color: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 600; }
.spm-empty p { margin: 0; }
.spm-empty button { height: 40px; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer; background: #0D2937; color: #FFFFFF; font: 700 13.5px/1 'Manrope', system-ui, sans-serif; }

.spm-foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid rgba(255, 255, 255, .06); background: #08202C; }
.spm-foot span { min-width: 0; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .5); }
.spm-foot .spm-open {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 10px; cursor: pointer;
  background: #00B175; color: #00140C; font: 800 13.5px/1 'Manrope', system-ui, sans-serif;
}
.spm-foot .spm-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.spm-foot .spm-open:hover { background: #00C482; }

/* phones: bottom sheet */
@media (max-width: 700px) {
  .spm-panel {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: 18px 18px 0 0;
    transform: translateY(100%); opacity: 1; transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  }
  .spm.is-open .spm-panel { transform: translateY(0); }
  .spm-grip { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: rgba(255, 255, 255, .22); }
  .spm-head { padding: 8px 14px 10px; background: #061A24; }
  .spm-teams { font-size: 14.5px; gap: 8px; }
  .spm-team { gap: 8px; }
  .spm-team .spx-crest { width: 26px; height: 26px; }
  .spm-team > span:not(.spx-crest) { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
  .spm-tabs { padding: 10px 14px; }
  .spm-body { padding: 4px 14px 12px; }
  .spm-row { gap: 6px; }
  .spm-row.is-many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spm-odd { height: 42px; padding: 0 10px; }
  .spm-odd span { font-size: 12px; }
  .spm-foot { padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .spm-foot span { display: none; }
  .spm-foot .spm-open { flex: 1; justify-content: center; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .spx-live i, .spx-live-count::before, .spx-odd.is-up, .spx-odd.is-down, .spm-odd.is-up, .spm-odd.is-down, .spm-wait i { animation: none; }
  .spm-panel, .spm-back { transition: none; }
}

/* ==========================================================================
   Fast start (8 Oct): the row is in the page from the first paint with
   placeholder cards of exactly the same size, so nothing below it moves
   when the matches arrive. Card height no longer depends on the content.
   ========================================================================== */
.spx-top { min-height: 22px; }
.spx-market { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spx-skel { cursor: default; pointer-events: none; }
.spx-skel .spx-league, .spx-skel .spx-team strong, .spx-skel .spx-market, .spx-skel .spx-ph { color: transparent; border-radius: 6px; background: rgba(255, 255, 255, .08); }
.spx-skel .spx-league { width: 52%; }
.spx-skel .spx-ph { width: 48px; }
.spx-skel .spx-team strong { width: 72%; }
.spx-skel .spx-market { width: 38%; margin-left: auto; margin-right: auto; }
.spx-skel .spx-vs { color: rgba(255, 255, 255, .22); }
.spx-skel .spx-crest, .spx-skel .spx-odd, .spx-skel .spx-more { background: rgba(255, 255, 255, .07); }
.spx-skel::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .05) 50%, transparent 70%) 150% 0 / 200% 100% no-repeat;
  animation: spxShimmer 1.4s linear infinite; }
@keyframes spxShimmer { to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .spx-skel::after { animation: none; } }
