/* Statistiche competizione — Marcatori e layout condiviso */

.xg-stats-card {
  background: linear-gradient(180deg, rgba(12, 20, 36, 0.92) 0%, rgba(8, 14, 26, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 16px 14px 12px;
  margin: 0 0 12px;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.04);
}

.xg-stats-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}

.xg-stats-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f1f5f9;
}

.xg-stats-meta {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
}

.xg-stats-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.xg-stats-filters.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.xg-stats-filter,
.xg-stats-md-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  font-size: 0.78rem;
}

.xg-stats-select {
  appearance: none;
  border: 0;
  background-color: #0f172a;
  color: #e2e8f0;
  color-scheme: dark;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  max-width: 11rem;
}

.xg-stats-select option,
.xg-stats-select optgroup {
  background-color: #0f172a;
  color: #e2e8f0;
}

.xg-stats-select:focus {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Sottonav */
.xg-stats-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.85);
}

.xg-stats-subnav__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 4px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.xg-stats-subnav__item:hover {
  color: #94a3b8;
}

.xg-stats-subnav__item.is-active {
  color: #22d3ee;
  border-bottom-color: #22d3ee;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}

.xg-stats-subnav__item--scorers.is-active {
  color: #f5d565;
  border-bottom-color: #d4a017;
  text-shadow: 0 0 10px rgba(212, 160, 23, 0.25);
}

.xg-stats-subnav__item--scorers.is-active .fa-shoe-prints {
  color: #d4a017;
}

.xg-stats-subnav__item--assists.is-active {
  color: #5eead4;
  border-bottom-color: #14b8a6;
  text-shadow: 0 0 10px rgba(20, 184, 166, 0.25);
}

.xg-stats-subnav__item--assists.is-active .fa-handshake {
  color: #14b8a6;
}

.xg-stats-subnav__item--keepers.is-active {
  color: #93c5fd;
  border-bottom-color: #3b82f6;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

.xg-stats-subnav__item--keepers.is-active .fa-hands {
  color: #3b82f6;
}

.xg-stats-subnav__item--discipline.is-active {
  color: #fcd34d;
  border-bottom-color: #eab308;
  text-shadow: 0 0 10px rgba(234, 179, 8, 0.2);
}

.xg-stats-subnav__item--discipline.is-active .fa-ban {
  color: #eab308;
}

/* Body + skeleton */
.xg-stats-body {
  position: relative;
  min-height: 80px;
}

.xg-stats-body.is-loading .xg-stats-scroll,
.xg-stats-body.is-loading .xg-stats-empty {
  visibility: hidden;
}

.xg-stats-skeleton {
  display: none;
  flex-direction: column;
  gap: 6px;
}

.xg-stats-body.is-loading .xg-stats-skeleton {
  display: flex;
}

.xg-stats-skeleton__row {
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  background-size: 200% 100%;
  animation: xg-stats-shimmer 1.2s ease-in-out infinite;
}

@keyframes xg-stats-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Tabella */
.xg-stats-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border-radius: 10px;
  border: 1px solid rgba(30, 41, 59, 0.85);
}

.xg-stats-table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.xg-stats-table thead th {
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 8px;
  border-bottom: 1px solid #1e293b;
  white-space: nowrap;
}

.xg-stats-th--num,
.xg-stats-th--goals,
.xg-stats-th--last5 {
  text-align: center;
}

.xg-stats-row {
  border-bottom: 1px solid rgba(30, 41, 59, 0.65);
  transition: background 0.15s ease;
}

.xg-stats-row[data-player-url] {
  cursor: pointer;
}

.xg-stats-row:hover,
.xg-stats-row:focus-within {
  background: rgba(56, 189, 248, 0.07);
}

.xg-stats-row--gold {
  box-shadow: inset 3px 0 0 0 #d4a017;
}

.xg-stats-row--silver {
  box-shadow: inset 3px 0 0 0 rgba(192, 192, 192, 0.55);
}

.xg-stats-row--bronze {
  box-shadow: inset 3px 0 0 0 rgba(180, 120, 70, 0.55);
}

.xg-stats-td {
  padding: 9px 8px;
  color: #e2e8f0;
  vertical-align: middle;
}

.xg-stats-td--num,
.xg-stats-td--goals,
.xg-stats-td--last5 {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.xg-stats-td--pos {
  width: 44px;
  text-align: center;
}

.xg-stats-pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 800;
  color: #cbd5e1;
}

.xg-stats-pos--top {
  color: #f5d565;
}

.xg-stats-boot,
.xg-stats-top-ico {
  font-size: 0.72rem;
  color: #d4a017;
  transform: rotate(-18deg);
}

.xg-stats-table--assists .xg-stats-top-ico {
  color: #14b8a6;
  transform: none;
}

.xg-stats-table--keepers .xg-stats-top-ico {
  color: #3b82f6;
  transform: none;
}

.xg-stats-player,
.xg-stats-team {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

a.xg-stats-player:hover .xg-stats-player__name,
a.xg-stats-team:hover .xg-stats-team__name {
  color: #7dd3fc;
  text-decoration: underline;
}

.xg-stats-player__photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #1e293b;
  border: 1px solid #334155;
}

.xg-stats-player__photo--ph {
  display: inline-block;
  background: #334155;
}

.xg-stats-player__name {
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

.xg-stats-team__logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
}

.xg-stats-team__logo--ph {
  display: inline-block;
  background: #334155;
}

.xg-stats-team__name {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
  color: #94a3b8;
}

.xg-stats-goals {
  font-size: 1.15rem;
  font-weight: 900;
  color: #f1f5f9;
}

.xg-stats-goals--leader,
.xg-stats-stat--leader {
  color: #f5d565;
}

.xg-stats-assists {
  font-size: 1.15rem;
  font-weight: 900;
  color: #5eead4;
}

.xg-stats-table--assists .xg-stats-stat--leader {
  color: #5eead4;
}

.xg-stats-cs {
  font-size: 1.15rem;
  font-weight: 900;
  color: #93c5fd;
}

.xg-stats-table--keepers .xg-stats-stat--leader {
  color: #93c5fd;
}

/* Disciplina — cartellini (non usare .xg-stats-card: è il pannello) */
.xg-stats-booking {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.xg-stats-booking--y {
  background: linear-gradient(180deg, #fde047 0%, #eab308 100%);
  color: #422006;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.35);
}

.xg-stats-booking--r {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.35);
}

.xg-stats-th--card-y,
.xg-stats-th--card-r,
.xg-stats-th--card-t,
.xg-stats-td--card-y,
.xg-stats-td--card-r,
.xg-stats-td--card-t {
  text-align: center;
}

.xg-stats-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(30, 41, 59, 0.75);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: flex-end;
  align-items: center;
}

.xg-stats-note {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  flex-basis: 100%;
  text-align: right;
}

/* Ultime 5 */
.xg-stats-last5 {
  display: inline-flex;
  gap: 3px;
  justify-content: center;
}

.xg-stats-l5 {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.xg-stats-l5--empty {
  background: transparent;
  border: 1px dashed rgba(51, 65, 85, 0.6);
}

.xg-stats-l5--zero {
  background: #1e293b;
  color: #64748b;
  border: 1px solid #334155;
}

.xg-stats-l5--one {
  background: rgba(34, 211, 238, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(34, 211, 238, 0.45);
}

.xg-stats-l5--multi {
  background: rgba(212, 160, 23, 0.18);
  color: #f5d565;
  border: 1px solid rgba(212, 160, 23, 0.5);
}

.xg-stats-order {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.xg-stats-empty {
  text-align: center;
  padding: 36px 20px 40px;
  color: #94a3b8;
  border: 1px dashed rgba(51, 65, 85, 0.75);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  margin-top: 4px;
}

.xg-stats-empty i {
  display: block;
  font-size: 1.75rem;
  color: #475569;
  margin: 0 auto 12px;
}

.xg-stats-empty p {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #cbd5e1;
}

.xg-stats-empty__hint {
  margin: 8px 0 0 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  max-width: 28rem;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Mobile */
@media (max-width: 900px) {
  .xg-stats-head {
    flex-direction: column;
  }

  .xg-stats-filters {
    width: 100%;
  }

  .xg-stats-select {
    max-width: 100%;
    min-width: 8rem;
  }

  .xg-stats-subnav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .xg-stats-subnav__item {
    flex-shrink: 0;
  }

  .xg-stats-table {
    min-width: 560px;
  }

  .xg-stats-table--with-apps .xg-stats-th--team,
  .xg-stats-table--with-apps .xg-stats-td--team,
  .xg-stats-table--with-apps .xg-stats-th--pres,
  .xg-stats-table--with-apps .xg-stats-td--pres,
  .xg-stats-table--with-apps .xg-stats-th--avg,
  .xg-stats-table--with-apps .xg-stats-td--avg {
    display: none;
  }

  .xg-stats-player__name {
    max-width: 9rem;
  }

  .xg-stats-td--last5 {
    display: table-cell;
  }
}

@media (max-width: 480px) {
  .xg-stats-card {
    padding: 12px 8px 10px;
  }

  .xg-stats-table {
    min-width: 320px;
  }

  .xg-stats-table--with-apps .xg-stats-th--last5,
  .xg-stats-table--with-apps .xg-stats-td--last5 {
    display: none;
  }
}

@media (min-width: 901px) {
  .xg-stats-scroll {
    overflow-x: visible;
  }

  .xg-stats-table {
    min-width: 100%;
  }

  .xg-stats-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }
}
