/* Pronisto extra2 — team page, H2H, widget, onboarding, alerts, invite, weekly prize.
   Uses the same CSS variables as melhorias/plus. Hides itself when a section has no data. */
.x2-root { color: var(--text); }

.x2-page {
  position: relative;
  min-height: 60dvh;
  padding: 8px 16px calc(96px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
}
.x2-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 12px;
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.x2-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 0 0 12px;
}
.x2-h { margin: 0 0 10px; font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.x2-muted { color: var(--muted); font-size: 13px; line-height: 1.45; }
.x2-small { font-size: 12px; }
.x2-team-head { display: flex; align-items: center; gap: 14px; }
.x2-team-head img, .x2-crest {
  width: 64px; height: 64px; object-fit: contain; background: none; border: 0; box-shadow: none; border-radius: 8px;
}
.x2-crest { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; background: var(--card-2); color: var(--text); }
.x2-team-head h1 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.15; }
.x2-stand { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; font-size: 13px; }
.x2-stand b { font-weight: 800; }
.x2-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 4px;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.x2-row:first-of-type, .x2-list .x2-row:first-child { border-top: 0; }
.x2-row:hover { background: color-mix(in srgb, var(--card-2) 70%, transparent); border-radius: 12px; }
.x2-when { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.x2-teams { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; font-weight: 700; }
.x2-teams span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.x2-teams img, .x2-teams .x2-crest { width: 18px; height: 18px; border-radius: 4px; }
.x2-score { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14px; white-space: nowrap; }
.x2-row > .x2-muted {
  max-width: 9.5rem;
  text-align: right;
  line-height: 1.25;
  justify-self: end;
}
.x2-h2h { padding-top: 8px; }

.x2-live { color: #e11d48; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

/* H2H tab — sits with existing match tabs */
.pr-mtabs .x2-htab { flex: 1 1 0; }
.x2-prize p { margin: 4px 0 0; }
.x2-h2h { padding: 4px 0 8px; }
.x2-h2h .x2-row { padding: 10px 2px; }

/* Widget */
body.x2-widget #root > *:not(.x2-widget-root),
body.x2-widget .app-nav,
body.x2-widget .pm-nav,
body.x2-widget #pr-consent,
body.x2-widget .pr-ad,
body.x2-widget #pr-trial-banner,
body.x2-widget #pr-ref-banner { display: none !important; }
body.x2-widget { background: var(--bg); }
.x2-widget-root { max-width: 420px; margin: 0 auto; padding: 12px 14px 24px; }
.x2-widget-root header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.x2-widget-root h1 { margin: 0; font-size: 16px; font-weight: 800; }
.x2-openapp { font-size: 12px; font-weight: 700; color: var(--accent); text-decoration: none; }

/* Onboarding */
.x2-onb-bg {
  position: fixed; inset: 0; z-index: 80; background: #0009;
  display: flex; align-items: flex-end; justify-content: center;
}
.x2-onb {
  width: 100%; max-width: 560px; max-height: 90dvh; overflow: auto;
  background: var(--card); color: var(--text);
  border-radius: 24px 24px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}
.x2-onb h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.x2-onb p { margin: 0 0 14px; }
.x2-onb input[type="search"] {
  width: 100%; min-height: 44px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); padding: 0 14px; font: inherit; font-size: 15px;
}
.x2-onb-results { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.x2-pick {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px;
  padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.x2-pick.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.x2-pick img, .x2-pick .x2-crest { width: 28px; height: 28px; border-radius: 6px; }
.x2-pick b { flex: 1; font-size: 14px; }
.x2-onb-actions { display: flex; gap: 8px; margin-top: 14px; }
.x2-onb-actions button, .x2-btn {
  flex: 1; min-height: 44px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--text); font: inherit; font-weight: 800; cursor: pointer;
}
.x2-btn-primary, .x2-onb-actions .x2-go { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.x2-tag { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }

/* Profile extras */
.x2-toggle { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.x2-toggle:first-of-type { border-top: 0; }
.x2-toggle input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.x2-toggle span { display: block; font-size: 14px; font-weight: 700; }
.x2-toggle small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.x2-prize { margin: 10px 0 0; padding: 10px 12px; border-radius: 14px; background: var(--card-2); font-size: 12.5px; line-height: 1.45; }
.x2-prize b { font-weight: 800; }
.x2-click { cursor: pointer; }
button.x2-click, a.x2-click { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: inherit; }
.x2-hidden { display: none !important; }

@media (min-width: 720px) {
  .x2-onb-bg { align-items: center; }
  .x2-onb { border-radius: 24px; }
}

/* Invite URL: fit on 360px without losing the full value (Copy still uses the full link). */
.pr-ref .pr-ref-row,
#x2-ref .pr-ref-row {
  min-width: 0;
  align-items: center;
}
.pr-ref .pr-ref-row input,
#x2-ref .pr-ref-row input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: 11.5px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pr-ref .pr-ref-row button,
.pr-ref .pr-ref-share,
#x2-ref .pr-ref-row button {
  flex: 0 0 auto;
}

/* H2H crests: always small and visible; hide broken logos via onerror. */
.x2-h2h .x2-teams img,
.x2-h2h .x2-teams img.x2-crest {
  width: 18px;
  height: 18px;
  display: inline-block;
  object-fit: contain;
  flex-shrink: 0;
  visibility: visible;
  background: none;
  border: 0;
  box-shadow: none;
}

/* Sticky match tabs sit under the header (z-index 15, same as match-tabs.css),
   below the bottom nav (40). Selected tab: accent green + underline. */
.match-page > .pr-mtabs,
.pr-mtabs-outside {
  position: sticky;
  top: var(--app-header-h, calc(58px + env(safe-area-inset-top, 0px)));
  z-index: 15;
  background: var(--bg, #070b14);
  backdrop-filter: blur(8px);
}
[data-theme="light"] .match-page > .pr-mtabs,
[data-theme="light"] .pr-mtabs-outside {
  background: var(--bg, #f3f5f2);
}
.match-page > .pr-mtabs .pr-mtab,
.pr-mtabs .pr-mtab {
  color: var(--muted, #8a93a3);
}
.match-page > .pr-mtabs .pr-mtab[aria-selected="true"],
.pr-mtabs .pr-mtab[aria-selected="true"],
.pr-mtabs .x2-htab[aria-selected="true"] {
  color: var(--accent, #22e58b);
  font-weight: 800;
  background: transparent;
}
[data-theme="dark"] .pr-mtabs .pr-mtab[aria-selected="true"],
[data-theme="dark"] .pr-mtabs .x2-htab[aria-selected="true"] {
  color: #22e58b;
}
[data-theme="light"] .pr-mtabs .pr-mtab[aria-selected="true"],
[data-theme="light"] .pr-mtabs .x2-htab[aria-selected="true"] {
  color: var(--accent, #0b9a5b);
}

/* Hide the standalone back row once the tab bar is present; the compact
   back control lives inside .pr-mtabs. */
.match-page:has(.pr-mtabs) > .match-back {
  display: none !important;
}

/* Hero card (crests, countdown/score, tip, share, palpite) only on Análise.
   The node stays in the DOM so the clock and live score keep ticking.
   Prefer data-active-tab (set by JS in every layout) so the hero still hides
   when aria-selected is missing. Keep the :has() rule as a fallback. */
.match-page[data-active-tab]:not([data-active-tab="analysis"]) > .match-hero,
.match-page:has(.pr-mtabs .pr-mtab[data-tab]:not([data-tab="analysis"])[aria-selected="true"]) > .match-hero {
  display: none !important;
}
@media (min-width: 1024px) {
  .match-page[data-active-tab]:not([data-active-tab="analysis"]) > .match-side,
  .match-page[data-active-tab]:not([data-active-tab="analysis"]) > .lockable,
  .match-page[data-active-tab]:not([data-active-tab="analysis"]) > .pr-mpanel,
  .match-page:has(.pr-mtabs .pr-mtab[data-tab]:not([data-tab="analysis"])[aria-selected="true"]) > .match-side,
  .match-page:has(.pr-mtabs .pr-mtab[data-tab]:not([data-tab="analysis"])[aria-selected="true"]) > .lockable,
  .match-page:has(.pr-mtabs .pr-mtab[data-tab]:not([data-tab="analysis"])[aria-selected="true"]) > .pr-mpanel {
    grid-column: 1 / -1;
  }
}

/* Selected tab colour also follows the is-active class, in case aria-selected is late. */
.pr-mtabs .pr-mtab.is-active,
.pr-mtabs .x2-htab.is-active {
  color: var(--accent, #22e58b);
  font-weight: 800;
  background: transparent;
}
[data-theme="dark"] .pr-mtabs .pr-mtab.is-active,
[data-theme="dark"] .pr-mtabs .x2-htab.is-active {
  color: #22e58b;
}
[data-theme="light"] .pr-mtabs .pr-mtab.is-active,
[data-theme="light"] .pr-mtabs .x2-htab.is-active {
  color: var(--accent, #0b9a5b);
}
.pr-mtab.is-active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #22e58b;
}

/* Narrow screens: shorter tab labels so 4 tabs + back stay on one line. */
.pr-mtab .pr-mtab-short { display: none; }
@media (max-width: 420px) {
  .pr-mtabs:has(.pr-mtab-back) .pr-mtab-full { display: none; }
  .pr-mtabs:has(.pr-mtab-back) .pr-mtab-short { display: block; }
}

/* Compact back control on the left of the sticky tab row. */
.pr-mtabs .pr-mtab-back {
  flex: 0 0 auto;
  width: 32px;
  min-width: 32px;
  height: 32px;
  margin: 0 2px 0 0;
  padding: 0;
  align-self: center;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line, #96bedc33);
  border-radius: 999px;
  background: var(--card, #101820);
  color: var(--text, #e8edf5);
  box-shadow: 0 1px 6px color-mix(in srgb, #000 14%, transparent);
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.pr-mtabs .pr-mtab-back svg {
  display: block;
  width: 18px;
  height: 18px;
}
.pr-mtabs .pr-mtab-back:hover,
.pr-mtabs .pr-mtab-back:focus-visible {
  border-color: var(--accent, #22e58b);
  color: var(--accent, #22e58b);
  outline: none;
}
.pr-mtabs .pr-mtab-back:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #22e58b) 35%, transparent);
}
[data-theme="light"] .pr-mtabs .pr-mtab-back {
  background: var(--card, #fff);
  color: var(--text, #102018);
  border-color: var(--line, #d5d8de);
}
[data-theme="light"] .pr-mtabs .pr-mtab-back:hover,
[data-theme="light"] .pr-mtabs .pr-mtab-back:focus-visible {
  color: var(--accent, #0b9a5b);
  border-color: var(--accent, #0b9a5b);
}

/* Keep four tabs + back readable at 360/390px. */
.pr-mtabs:has(.pr-mtab-back) {
  padding-left: 6px;
  padding-right: 4px;
  gap: 0;
}
.pr-mtabs:has(.pr-mtab-back) .pr-mtab {
  padding-left: 2px;
  padding-right: 2px;
  font-size: 11px;
}
.pr-mtabs:has(.pr-mtab-back) .pr-mtab .pr-mtab-icon,
.pr-mtabs:has(.pr-mtab-back) .pr-mtab svg.pr-mtab-icon {
  width: 18px;
  height: 18px;
}
