/**
 * App-wide dark/light surface system (FotMob-style).
 * Black canvas, elevated cards — consistent across all pages.
 */

:root {
  --match-dark-bg: #000000;
  --match-card-bg: #1a1a1a;
  --match-border: #2a2a2a;
  --match-text-muted: #888888;
  --match-text-light: #cccccc;
  --card-bg: var(--match-card-bg);
}

[data-theme="light"] {
  --match-dark-bg: #f0f0f0;
  --match-card-bg: #ffffff;
  --match-border: #e2e8f0;
  --match-text-muted: #5b6578;
  --match-text-light: #3d4759;
  --text-primary: #14181f;
  --text-secondary: #3d4759;
  --text-muted: #5b6578;
}

/* Readable focus rings on light surfaces (header nav keeps white outline) */
[data-theme="light"] a:focus-visible,
[data-theme="light"] button:focus-visible,
[data-theme="light"] input:focus-visible,
[data-theme="light"] select:focus-visible,
[data-theme="light"] textarea:focus-visible,
[data-theme="light"] .btn:focus-visible,
[data-theme="light"] [role="button"]:focus-visible {
  outline: 2px solid rgba(74, 124, 89, 0.9);
  outline-offset: 2px;
}

[data-theme="light"] .primary-nav__trigger:focus-visible,
[data-theme="light"] .primary-nav__link:focus-visible,
[data-theme="light"] .header-search-btn:focus-visible {
  outline: 2px solid rgba(74, 124, 89, 0.9);
  outline-offset: 2px;
}

[data-theme="light"] .card,
[data-theme="light"] .match-card,
[data-theme="light"] .panel,
[data-theme="light"] .stat-card,
[data-theme="light"] .content-card {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

body {
  background-color: var(--match-dark-bg) !important;
  color: var(--text-primary, #f0f0f0);
}

/* Hamburger menu removed — bottom nav replaces mobile navigation */
.hamburger-btn,
.mobile-menu,
#mobile-menu {
  display: none !important;
}

/* ── Elevated surfaces ───────────────────────────────────────────── */
.card,
.match-card,
.panel,
.stat-card,
.content-card,
.sidebar .card,
.card-sidebar,
.card-sidebar-compact,
.enhanced-table,
.betting-stats-table,
.tab-panel,
.filter-container,
.match-control-bar,
.calendar-slideshow {
  background-color: var(--match-card-bg);
  border-color: var(--match-border);
}

.card,
.match-card {
  border: 1px solid var(--match-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .card,
[data-theme="light"] .match-card {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.filter-select,
.mobile-day-dropdown,
.search-input,
.timezone-select,
.league-dropdown-trigger,
.day-pill,
.day-nav-arrow,
.calendar-day {
  background-color: var(--match-card-bg);
  border-color: var(--match-border);
  color: var(--text-primary, #fff);
}

.enhanced-table thead th,
.betting-stats-table thead th {
  background-color: var(--match-card-bg);
  border-color: var(--match-border);
}

.enhanced-table tbody td,
.betting-stats-table tbody td {
  border-color: var(--match-border);
}

.tab-nav,
.tab-nav--equal {
  border-color: var(--match-border);
}

/* ── Bottom navigation (mobile / tablet, all pages) ─────────────── */
.market-bottom-nav {
  display: none;
}

@media (max-width: 1133px) {
  :root {
    --bottom-nav-offset: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  .market-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
    justify-content: flex-start;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    padding-left: max(6px, env(safe-area-inset-left, 0px));
    padding-right: max(6px, env(safe-area-inset-right, 0px));
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--match-border, #2a2a2a);
  }

  /* Grow evenly when all tabs fit; at narrow widths sum of mins > 100% → horizontal scroll */
  .market-bottom-nav__item {
    flex: 1 0 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 48px;
    min-width: 52px;
    padding: 5px 2px;
    color: var(--text-muted, #888);
    text-decoration: none;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
  }

  .market-bottom-nav__label {
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: center;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .market-bottom-nav__item.is-active {
    color: var(--confidence-high, #22c55e);
  }

  /* 22×22 icon canvas (reference spec); stroke icons — do not set fill here */
  .market-bottom-nav__icon {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    overflow: visible;
    pointer-events: none;
  }

  .container {
    padding-bottom: var(--bottom-nav-offset) !important;
  }

  /* Hide desktop primary nav — bottom nav replaces it on small screens */
  .global-header-inner .primary-nav {
    display: none !important;
  }
}

@media (min-width: 1134px) {
  .market-bottom-nav {
    display: none !important;
  }
}

[data-theme="light"] .market-bottom-nav {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: rgba(15, 23, 42, 0.1);
}

/* ── Matches page: date control bar ─────────────────────────────── */
body.page-matches .match-control-bar {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 0;
  position: static;
  background: var(--match-card-bg);
  border: 1px solid var(--match-border);
  border-radius: 12px;
  box-sizing: border-box;
}

body.page-matches .match-control-bar .day-navigation {
  padding: 0 12px;
  margin-bottom: 10px;
}

body.page-matches .match-control-bar .league-filter-row {
  padding: 0 12px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 1133px) {
  body.page-matches .container {
    padding-left: var(--page-gutter, 12px) !important;
    padding-right: var(--page-gutter, 12px) !important;
  }

  body.page-matches .match-control-bar {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    border-radius: 12px;
    border-left: 1px solid var(--match-border);
    border-right: 1px solid var(--match-border);
  }

  body.page-matches .content > .match-control-bar {
    margin-bottom: 8px;
  }

  body.page-matches .content > .card,
  body.page-matches .content > .match-card {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    box-sizing: border-box;
  }

  body.page-matches .match-card .enhanced-table tbody tr {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (min-width: 1134px) {
  body.page-matches .match-control-bar {
    border-radius: 12px;
  }
}

/* Layout-centered pages (match detail, h2h) */
body.layout-centered .card,
body.layout-centered .match-card {
  background-color: var(--match-card-bg) !important;
  border-color: var(--match-border) !important;
}

/* ── Primary navigation (desktop flyouts) ───────────────────────── */
.primary-nav {
  display: none;
}

@media (min-width: 1134px) {
  .primary-nav {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .primary-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .primary-nav__item {
    position: relative;
  }

  .primary-nav__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 10px;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-family: var(--font-heading, inherit);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.18s ease;
  }

  .primary-nav__link {
    text-decoration: none;
  }

  .primary-nav__trigger:hover,
  .primary-nav__item--has-panel:hover .primary-nav__trigger,
  .primary-nav__item--has-panel:focus-within .primary-nav__trigger {
    background: transparent;
    color: #fff;
    box-shadow: none;
  }

  .primary-nav__trigger.is-active,
  .primary-nav__trigger[aria-expanded="true"] {
    background: transparent;
    color: #fff;
    box-shadow: none;
  }

  .primary-nav__trigger::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 2px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.92);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.18s ease;
    pointer-events: none;
  }

  .primary-nav__trigger.is-active::after,
  .primary-nav__trigger:hover::after,
  .primary-nav__trigger[aria-expanded="true"]::after {
    transform: scaleX(1);
  }

  [data-theme="light"] .primary-nav__trigger {
    color: #000000;
  }

  [data-theme="light"] .primary-nav__trigger:hover,
  [data-theme="light"] .primary-nav__item--has-panel:hover .primary-nav__trigger,
  [data-theme="light"] .primary-nav__item--has-panel:focus-within .primary-nav__trigger,
  [data-theme="light"] .primary-nav__trigger.is-active,
  [data-theme="light"] .primary-nav__trigger[aria-expanded="true"] {
    background: transparent;
    color: #000000;
    box-shadow: none;
  }

  [data-theme="light"] .primary-nav__trigger::after {
    background: #000000;
  }

  .primary-nav__trigger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
  }

  .primary-nav__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: var(--match-card-bg, #1a1a1a);
    border: 1px solid var(--match-border, #2a2a2a);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    padding: 8px 0;
    z-index: 2500;
  }

  /* Invisible bridge so the cursor can reach the panel without closing */
  .primary-nav__panel::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
  }

  .primary-nav__panel:not([hidden]) {
    display: block;
  }

  .primary-nav__panel--mega {
    min-width: min(720px, 92vw);
    padding: 14px 16px;
  }

  .primary-nav__panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .primary-nav__panel-list a {
    display: block;
    padding: 9px 16px;
    color: var(--text-primary, #f0f0f0);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
  }

  .primary-nav__panel-list a:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .primary-nav__panel-footer {
    margin: 6px 0 0;
    padding: 8px 16px 4px;
    border-top: 1px solid var(--match-border, #2a2a2a);
    font-size: 12px;
  }

  .primary-nav__panel-footer a {
    color: var(--text-muted, #888);
    text-decoration: none;
  }

  .primary-nav__panel-divider {
    height: 1px;
    margin: 6px 0;
    background: var(--match-border, #2a2a2a);
    list-style: none;
  }

  .primary-nav__panel-heading {
    list-style: none;
    margin: 0;
    padding: 8px 16px 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #888);
    pointer-events: none;
  }

  .primary-nav__panel-heading:first-child {
    padding-top: 4px;
  }

  .primary-nav__mega-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 0.9fr;
    gap: 16px;
  }

  .primary-nav__mega-heading {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #888);
  }

  .primary-nav__mega-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .primary-nav__mega-list a {
    display: block;
    padding: 6px 0;
    color: var(--text-primary, #f0f0f0);
    text-decoration: none;
    font-size: 13px;
    text-transform: none;
    letter-spacing: normal;
  }

  .primary-nav__mega-league-link {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .primary-nav__mega-league-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
  }

  .primary-nav__mega-country-link {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .primary-nav__mega-country-flag {
    width: 18px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
  }

  .primary-nav__mega-list a:hover {
    color: var(--confidence-high, #22c55e);
  }

  .primary-nav__mega-list--scroll {
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.1);
  }

  .primary-nav__mega-list--scroll::-webkit-scrollbar {
    width: 8px;
  }

  .primary-nav__mega-list--scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
  }

  .primary-nav__mega-list--scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
  }

  .primary-nav__mega-list--scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
  }

  .primary-nav__count {
    color: var(--text-muted, #888);
    font-size: 12px;
  }
}

/* ── Stats market strip (secondary nav) — hidden site-wide ─────── */
.stats-market-strip {
  display: none !important;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  padding: 7px 20px;
  background: var(--global-palette1, #1e3a2f);
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0 0 14px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.global-header-inner.search-panel-open .stats-market-strip {
  border-radius: 0;
}

.stats-market-strip__item {
  flex: 0 0 auto;
  min-width: 0;
  padding: 5px 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-family: var(--font-heading, inherit);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.stats-market-strip .market-bottom-nav__icon {
  display: none;
}

@media (max-width: 1133px) {
  /* Mobile/tablet: use bottom nav Stats tab instead of secondary strip */
  .stats-market-strip {
    display: none !important;
  }
}

.stats-market-strip__item:hover,
.stats-market-strip__item.is-active {
  color: #fff;
}

.stats-market-strip__item.is-active {
  color: var(--confidence-high, #22c55e);
}

.stats-market-strip__sep {
  color: rgba(255, 255, 255, 0.28);
  user-select: none;
  padding: 0;
  line-height: 1;
  font-weight: 400;
  align-self: center;
}

.stats-market-strip__label--short {
  display: none;
}

@media (max-width: 360px) {
  .stats-market-strip__label--full {
    display: none;
  }

  .stats-market-strip__label--short {
    display: inline;
  }
}

[data-theme="light"] .stats-market-strip {
  background: #2d5a42;
}

/* ── Prediction market strip (contextual) ───────────────────────── */
.prediction-market-strip {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  padding: 6px 10px;
  margin: 0 12px 10px;
  background: var(--match-card-bg, #1a1a1a);
  border: 1px solid var(--match-border, #2a2a2a);
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prediction-market-strip__item {
  flex: 1 0 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 56px;
  padding: 5px 4px;
  color: var(--text-muted, #888);
  text-decoration: none;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.prediction-market-strip__item.is-active {
  color: var(--confidence-high, #22c55e);
}

.prediction-market-strip__label {
  line-height: 1.15;
}

.prediction-market-strip__icon,
.prediction-market-strip .market-bottom-nav__icon {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  overflow: visible;
  pointer-events: none;
}

@media (min-width: 1134px) {
  /* Desktop uses Predictions flyout — strip is mobile/tablet only */
  .prediction-market-strip {
    display: none !important;
  }
}

/* ── Mobile predictions bottom sheet ────────────────────────────── */
.market-bottom-nav__item--button {
  border: none;
  background: transparent;
  cursor: pointer;
  /* Keep tab typography from .market-bottom-nav__item — do not use font: inherit */
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.predictions-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
  pointer-events: none;
  visibility: hidden;
}

.predictions-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
}

.predictions-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.predictions-sheet.is-open .predictions-sheet__backdrop {
  opacity: 1;
}

.predictions-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 75vh;
  background: var(--match-card-bg, #1a1a1a);
  border-top: 1px solid var(--match-border, #2a2a2a);
  border-radius: 16px 16px 0 0;
  padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.predictions-sheet.is-open .predictions-sheet__panel {
  transform: translateY(0);
}

.predictions-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--match-border, #2a2a2a);
}

.predictions-sheet__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.predictions-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #fff);
  cursor: pointer;
}

.predictions-sheet__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.predictions-sheet__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  color: var(--text-primary, #f0f0f0);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.predictions-sheet__link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.predictions-sheet__footer {
  margin: 0;
  padding: 10px 18px 4px;
  font-size: 13px;
  border-top: 1px solid var(--match-border, #2a2a2a);
}

.predictions-sheet__footer a {
  color: var(--text-muted, #888);
  text-decoration: none;
}

body.predictions-sheet-open {
  overflow: hidden;
}

@media (min-width: 1134px) {
  .predictions-sheet {
    display: none !important;
  }

  .markets-sheet {
    display: none !important;
  }
}

/* ── Mobile markets bottom sheet ────────────────────────────────── */
.markets-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
  pointer-events: none;
  visibility: hidden;
}

.markets-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
}

.markets-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.markets-sheet.is-open .markets-sheet__backdrop {
  opacity: 1;
}

.markets-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 70vh;
  background: var(--match-card-bg, #1a1a1a);
  border-top: 1px solid var(--match-border, #2a2a2a);
  border-radius: 16px 16px 0 0;
  padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.28s ease;
  touch-action: pan-y;
}

.markets-sheet.is-open .markets-sheet__panel {
  transform: translateY(0);
}

.markets-sheet__handle-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}

.markets-sheet__handle {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-medium, #3a4248);
}

.markets-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--match-border, #2a2a2a);
}

.markets-sheet__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary, #f0f0f0);
}

.markets-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #fff);
  cursor: pointer;
}

.markets-sheet__rows {
  display: flex;
  flex-direction: column;
  padding: 0 0 4px;
}

.markets-sheet__row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  color: var(--text-primary, #f0f0f0);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-top: 1px solid var(--match-border, #2a2a2a);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.markets-sheet__row:first-child {
  border-top: none;
}

.markets-sheet__row:active,
.markets-sheet__row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.markets-sheet__row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: inherit;
}

.markets-sheet__row-icon svg,
.markets-sheet__row-icon .market-bottom-nav__icon {
  display: block;
  width: 22px;
  height: 22px;
}

.markets-sheet__row-label {
  flex: 1 1 auto;
  min-width: 0;
}

.markets-sheet__row-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted, #888);
}

.markets-sheet__row-chevron svg {
  display: block;
  width: 18px;
  height: 18px;
}

body.markets-sheet-open {
  overflow: hidden;
}

.market-bottom-nav__icon--24 {
  width: 20px;
  height: 20px;
}

/* ── Mobile stats bottom sheet (mirrors markets sheet) ──────────── */
@media (min-width: 1134px) {
  .stats-sheet {
    display: none !important;
  }
}

.stats-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
  pointer-events: none;
  visibility: hidden;
}

.stats-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
}

.stats-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.stats-sheet.is-open .stats-sheet__backdrop {
  opacity: 1;
}

.stats-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78vh;
  overflow-y: auto;
  background: var(--match-card-bg, #1a1a1a);
  border-top: 1px solid var(--match-border, #2a2a2a);
  border-radius: 16px 16px 0 0;
  padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.28s ease;
  touch-action: pan-y;
}

.stats-sheet.is-open .stats-sheet__panel {
  transform: translateY(0);
}

.stats-sheet__handle-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}

.stats-sheet__handle {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--border-medium, #3a4248);
}

.stats-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--match-border, #2a2a2a);
}

.stats-sheet__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary, #f0f0f0);
}

.stats-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, #fff);
  cursor: pointer;
}

.stats-sheet__rows {
  display: flex;
  flex-direction: column;
  padding: 0 0 4px;
}

.stats-sheet__section-label {
  padding: 14px 18px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #888);
}

.stats-sheet__row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  color: var(--text-primary, #f0f0f0);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-top: 1px solid var(--match-border, #2a2a2a);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.stats-sheet__section-label + .stats-sheet__row {
  border-top: none;
}

.stats-sheet__row:active,
.stats-sheet__row:hover,
.stats-sheet__row.is-current {
  background: rgba(255, 255, 255, 0.04);
}

/* Team stats ↔ Players page switch */
.stats-family-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--match-border, #2a2a2a);
  background: color-mix(in srgb, var(--text-primary, #fff) 3%, var(--match-card-bg, #1a1a1a));
  flex: 0 0 auto;
}

.stats-family-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted, #888);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
  transition: background 0.12s ease, color 0.12s ease;
}

.stats-family-switch__btn:hover {
  color: var(--text-primary, #fff);
}

.stats-family-switch__btn.is-active {
  background: var(--match-card-bg, #1a1a1a);
  color: var(--text-primary, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--global-palette2, #629670) 45%, var(--match-border, #2a2a2a));
}

[data-theme="light"] .stats-family-switch {
  background: #f3f4f6;
  border-color: #e2e8f0;
}

[data-theme="light"] .stats-family-switch__btn {
  color: #64748b;
}

[data-theme="light"] .stats-family-switch__btn:hover {
  color: #0f172a;
}

[data-theme="light"] .stats-family-switch__btn.is-active {
  background: #fff;
  color: #0f172a;
}

.stats-sheet__row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--global-palette2, #629670);
}

.stats-sheet__row-icon svg,
.stats-sheet__row-icon .market-bottom-nav__icon {
  display: block;
  width: 22px;
  height: 22px;
}

.stats-sheet__row-label {
  flex: 1 1 auto;
  min-width: 0;
}

.stats-sheet__row-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted, #888);
}

.stats-sheet__row-chevron svg {
  display: block;
  width: 18px;
  height: 18px;
}

body.stats-sheet-open {
  overflow: hidden;
}

[data-theme="light"] .stats-sheet__panel {
  background: #fff;
  border-top-color: #e2e8f0;
}

[data-theme="light"] .stats-sheet__title,
[data-theme="light"] .stats-sheet__close,
[data-theme="light"] .stats-sheet__row {
  color: #0f172a;
}

[data-theme="light"] .stats-sheet__row:active,
[data-theme="light"] .stats-sheet__row:hover,
[data-theme="light"] .stats-sheet__row.is-current {
  background: rgba(15, 23, 42, 0.04);
}

/* Phase A — entity native selects: touch-compact @ mobile/tablet (scoped) */
@media (max-width: 1133px) {
  .snx-entity-select,
  .competitions-select,
  .team-hero-header #season-selector,
  .team-hero-header #nt-competition-selector {
    min-height: 36px;
    box-sizing: border-box;
    padding-block: 8px;
    padding-inline: 10px;
    line-height: 1.25;
  }

  .snx-entity-select:focus-visible,
  .competitions-select:focus-visible,
  .team-hero-header #season-selector:focus-visible,
  .team-hero-header #nt-competition-selector:focus-visible {
    outline: 2px solid rgba(74, 124, 89, 0.65);
    outline-offset: 2px;
  }
}
