/* MSport - site */
/* Logos and avatars (shared with the administrator) */
.msport-logo,
.msport-avatar {
  flex: 0 0 auto;
  width: var(--msport-size, 32px);
  height: var(--msport-size, 32px);
  vertical-align: middle;
}

.msport-logo {
  object-fit: contain;
  border-radius: 0.35rem;
}

.msport-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: calc(var(--msport-size, 32px) * 0.4);
  font-weight: 700;
  line-height: 1;
  user-select: none;
}

.msport-avatar[data-initials]::before {
  content: attr(data-initials);
}

.msport-sporticon {
  font-size: calc(var(--msport-size, 32px) * 0.5);
}

.msport-team {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.container_calendar .evento_equipos .msport-logo,
.container_calendar .evento_equipos .msport-avatar {
  margin-inline: 0.2em;
}
.msport-filters label {
  font-weight: 600;
}

.msport-resultados-view .accordion-button .badge {
  font-weight: 500;
}

.msport-resultados-view .td_descanso span + span::before {
  content: ", ";
}

table.msport-sortable th.sortable {
  cursor: pointer;
  user-select: none;
}

table.msport-sortable th.sortable::after {
  content: " \2195";
  color: #999;
  font-size: 0.85em;
}

table.msport-sortable th[aria-sort="ascending"]::after {
  content: " \2191";
}

table.msport-sortable th[aria-sort="descending"]::after {
  content: " \2193";
}

a.msport_print {
  cursor: pointer;
}

a.msport_print::before {
  content: "\f02f  ";
  font-family: "Font Awesome 6 Free", "FontAwesome";
  font-weight: 900;
}

/* bootstrap-calendar was written for Bootstrap 2/3 */
.container_calendar .pull-right {
  float: right;
}

.container_calendar .pull-left {
  float: left;
}

.container_calendar .hide {
  display: none;
}

.container_calendar .row-fluid {
  display: flex;
  flex-wrap: wrap;
}

.container_calendar .badge-important {
  color: #fff;
}

.container_calendar .evento_deporte {
  display: inline-block;
  margin-inline-end: 0.4em;
  padding: 0 0.4em;
  border-radius: 0.25em;
  color: #fff;
}

/* Calendar modal: match card (header, scoreboard, details). Lines and secondary text derive from
   currentColor, so they follow the theme (css/estilos) when there is one. */
.msport-pop {
  --pop-muted: color-mix(in srgb, currentColor 62%, transparent);
  --pop-line: color-mix(in srgb, currentColor 14%, transparent);
}

.msport-pop-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--pop-line);
}

.msport-pop-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

#events-modal .msport-pop-sport {
  margin: 0;
  color: var(--pop-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.msport-pop-comp {
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.msport-pop-comp:hover,
.msport-pop-comp:focus {
  text-decoration: underline;
}

.msport-pop-round {
  color: var(--pop-muted);
  font-size: 0.9rem;
}

/* Scoreboard: home | score | away; names wrap inside their column */
#events-modal .msport-pop-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  margin: 0;
  padding: 1.5rem 0;
}

#events-modal .msport-pop-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
  text-align: center;
  text-decoration: none;
}

a.msport-pop-team:hover .msport-pop-name,
a.msport-pop-team:focus .msport-pop-name {
  text-decoration: underline;
}

.msport-pop-team .msport-logo,
.msport-pop-team .msport-avatar {
  display: flex;
  transition: transform 0.15s ease;
}

a.msport-pop-team:hover :is(.msport-logo, .msport-avatar) {
  transform: scale(1.05);
}

.msport-pop-name {
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.msport-pop-team.is-winner .msport-pop-name {
  font-weight: 800;
}

.msport-pop-team.is-loser {
  opacity: 0.75;
}

.msport-pop-role {
  color: var(--pop-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.msport-pop-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 6rem;
  padding-top: 0.6rem;
}

.msport-pop-result {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#events-modal .msport-pop-result .badge {
  min-width: 2.4em;
  padding: 0.45em 0.6em;
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#events-modal .msport-pop-result .badge.is-loser {
  opacity: 0.7;
}

.msport-pop-sep {
  color: var(--pop-muted);
  font-size: 1.5rem;
  font-weight: 700;
}

.msport-pop-vs {
  color: var(--pop-muted);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.msport-pop-state {
  color: var(--pop-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* More specific than the themes' ".marcador .badge", which sizes the score */
#events-modal .marcador .msport-pop-centre .msport-pop-state.badge {
  min-width: 0;
  padding: 0.5em 0.8em;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
}

/* Details: date, time, venue */
.msport-pop-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.6rem 1.25rem;
  margin: 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--pop-line);
  list-style: none;
}

.msport-pop-info li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}

.msport-pop-info .msport-icon {
  flex: 0 0 1.1em;
  text-align: center;
  opacity: 0.7;
}

.msport-pop-info li:last-child:nth-child(3) {
  grid-column: 1 / -1;
}

.msport-pop-address {
  display: block;
  color: var(--pop-muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
  #events-modal .msport-pop-board {
    gap: 0.5rem;
    padding: 1.1rem 0;
  }

  .msport-pop-team .msport-logo,
  .msport-pop-team .msport-avatar {
    width: 48px !important;
    height: 48px !important;
  }

  .msport-pop-centre {
    min-width: 4.5rem;
  }

  #events-modal .msport-pop-result .badge {
    font-size: 1.35rem;
  }

  .msport-pop-name {
    font-size: 0.9rem;
  }
}

@media print {
  #msport-restrictor_resultados,
  .com-msport-pagination,
  a.msport_print {
    display: none !important;
  }

  .msport-resultados-view .accordion-collapse.collapse {
    display: block !important;
  }

  .msport-compact .msport-extra {
    display: table-cell !important;
  }

  .msport-more-btn {
    display: none !important;
  }
}

.msport-racha {
  min-width: 1.6em;
  color: #fff;
}

.msport-racha-G {
  background-color: var(--bs-success, #198754);
}

.msport-racha-E {
  background-color: var(--bs-secondary, #6c757d);
}

.msport-racha-P {
  background-color: var(--bs-danger, #dc3545);
}

/* Narrow screens: the round header (title, competition, date) wraps instead of widening the page. */
.msport-resultados-view .accordion-button {
    flex-wrap: wrap;
    gap: .25rem;
}

.msport-resultados-view .accordion-button .jornada_titulo {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Match list (team, venue and competition pages): date, time and venue on a top line, then home - score - away.
   Names wrap inside their column, so the list never needs side scrolling. */
.msport-match-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.msport-match {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--msport-line, var(--border-color, #dfe3e7));
}

.msport-match:last-child {
  border-bottom: 0;
}

.msport-match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}


.msport-match-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.3;
}

.msport-match-home {
  text-align: end;
}

.msport-match-home .msport-team {
  flex-direction: row-reverse;
}

.msport-match-teams .msport-team {
  max-width: 100%;
}

.msport-match-teams .msport-team-name {
  min-width: 0;
  overflow-wrap: break-word;
}

.msport-match-score {
  min-width: 3rem;
  text-align: center;
  white-space: nowrap;
}

.msport-match-rest {
  padding: 0.5rem 0 0;
}

@media (max-width: 575.98px) {
  .msport-match-teams {
    gap: 0.35rem;
    font-size: 0.85rem;
  }

  .msport-match-teams .msport-team {
    gap: 0.3rem;
  }

  .msport-match-teams .msport-logo,
  .msport-match-teams .msport-avatar {
    width: 1.25rem !important;
    height: 1.25rem !important;
    font-size: 0.5rem !important;
  }

  .msport-match-score {
    min-width: 2.6rem;
  }

  /* Tables (standings, results): smaller type and tighter cells so they fit without side scrolling */
  .com-msport .table {
    font-size: 0.85rem;
  }

  .com-msport .table > :not(caption) > * > * {
    padding-inline: 0.3rem;
  }
}

/* Competition page: tabs on the left, "more data" button on the right, on the same line */
.msport-section-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

/* Compact standings: only the team, PJ, PTS and streak until the button expands the rest */
.msport-compact:not(.msport-expanded) .msport-extra {
  display: none;
}

/* Font Awesome icons next to labels, headings and tabs (decorative: the text always carries the meaning) */
.msport-icon {
  margin-inline-end: 0.15em;
  font-size: 0.9em;
  opacity: 0.85;
}

.msport-match-meta .msport-icon {
  margin-inline-end: 0.3em;
}

.container_calendar [data-calendar-view] .msport-icon {
  margin-inline-end: 0.3em;
}
