/* Shared skin for league and tournament group matches. */
body[data-page="league-view"] #tfpCompetitionView #matches .league-matches-toolbar__filters {
  display: contents !important;
}

body[data-page="league-view"] #tfpCompetitionView #matches .league-match-status-tab [data-match-filter-count] {
  border-radius: 999px !important;
}

body[data-page="league-view"] #tfpCompetitionView #matches .league-card__head h3 {
  display: flex;
  align-items: center;
  gap: 14px;
}

body[data-page="league-view"] #tfpCompetitionView #matches .league-card__head h3::before {
  content: "" !important;
  display: block !important;
  flex: 0 0 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--group-color, #2563eb);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--group-color, #2563eb) 16%, transparent);
}

@media (max-width: 700px) {
  body[data-page="league-view"] #tfpCompetitionView #matches .league-matches-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-page="league-view"] #tfpCompetitionView #matches .league-search-box {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card {
  --tfp-match-inset: 12px;
  padding: var(--tfp-match-inset) !important;
  border: 1.5px solid #405b7c !important;
  border-left: 4px solid #6c39c3 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 2px 4px #1534520c !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .league-match-top {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px 8px !important;
  width: auto !important;
  margin: calc(-1 * var(--tfp-match-inset)) calc(-1 * var(--tfp-match-inset)) 10px !important;
  padding: 7px var(--tfp-match-inset) !important;
  border-bottom: 1px solid #e0d9ef;
  border-radius: 10px 10px 0 0;
  background: #f1edf9;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card :is(.league-match-badges, .league-match-panel-links) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  flex: 0 1 auto !important;
  gap: 5px !important;
  width: auto !important;
  min-width: 0;
  max-width: 100%;
  overflow: visible !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .league-match-panel-links {
  justify-content: flex-end !important;
  margin-inline-start: auto !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .league-badge {
  border-radius: 6px !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-match-schedule {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #17304f !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card :is(.league-panel-link--referee, .league-panel-link--coach) {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 36px !important;
  padding: 5px 8px !important;
  background: #eef7f8 !important;
  border: 1px solid #c3dde1 !important;
  border-radius: 7px !important;
  color: #14505a !important;
  font-size: 12px !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-match-options-trigger {
  display: none !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px !important;
  padding: 5px 8px !important;
  border: 1px solid #58728e !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: #17304f !important;
  font: inherit;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: none !important;
  cursor: pointer;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-match-options-trigger span {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page[data-match-options-ready="1"] #matches .tfp-match-options-trigger {
  display: inline-flex !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page[data-match-options-ready="1"] #matches .tfp-result-card[data-match-options-card] .tfp-result-types {
  display: none !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-match-options-trigger:hover {
  background: #f7f4ff !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .league-match-players-row {
  align-items: stretch !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .league-match-player {
  justify-content: flex-start !important;
  padding: 7px 8px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .league-match-player :is(strong, .tfp-pair-member, .tfp-player-link) {
  font-weight: 600 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-types {
  border-color: #d6dfeb !important;
  border-radius: 9px !important;
  background: #f3f5f9 !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-types label > span {
  min-height: 42px !important;
  border-radius: 6px !important;
  color: #233b50 !important;
  font-weight: 650 !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-types input:checked + span {
  background: #6031bc !important;
  background-image: none !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  opacity: 1 !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-types input[value="walkover"]:checked + span {
  background: #76511b !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-types input[value="retirement"]:checked + span {
  background: #85374e !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-order {
  color: #3e5368 !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-set label {
  min-height: 2.4em;
  align-items: flex-end;
  color: #263e54 !important;
  font-weight: 650 !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-editor select {
  height: 44px !important;
  border-color: #bccbdb !important;
  border-radius: 8px !important;
  background-color: #fff !important;
  color: #18344c !important;
  -webkit-text-fill-color: currentColor !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .league-match-actions > .league-save-btn {
  background: #067450 !important;
  background-image: none !important;
  border-color: #067450 !important;
  border-radius: 8px !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .league-match-actions > .league-save-btn:not(:disabled):hover {
  background: #055d40 !important;
}

body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card :is(select, input[type="number"], .league-save-btn):focus-visible,
body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-types input:focus-visible + span {
  outline: 2px solid #673ac5 !important;
  outline-offset: 2px;
}

/* Center the contents of league match cards. */
body[data-page="league-view"] #tfpCompetitionView.league-page #matches .tfp-result-card {
  text-align: center;
}

body[data-page="league-view"] #tfpCompetitionView.league-page #matches .tfp-result-card :is(
  .league-match-top, .league-match-badges, .league-match-panel-links, .league-match-player, .tfp-result-set label
) {
  justify-content: center !important;
}

body[data-page="league-view"] #tfpCompetitionView.league-page #matches .tfp-result-card .league-match-panel-links {
  margin-inline-start: 0 !important;
}

body[data-page="league-view"] #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-pair-stack {
  justify-items: center !important;
}

body[data-page="league-view"] #tfpCompetitionView.league-page #matches .tfp-result-card :is(
  .league-match-player, .league-match-player strong, .league-match-player strong *,
  .tfp-result-editor label, .tfp-result-editor select
) {
  text-align: center !important;
}

body[data-page="league-view"] #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-editor select {
  text-align-last: center;
}

body[data-page="league-view"] #tfpCompetitionView.league-page #matches .tfp-result-card [data-result-score-hint] {
  display: none !important;
}

body[data-page="league-view"] #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-set {
  grid-template-rows: 1fr auto;
}

body[data-page="league-view"] #tfpCompetitionView.league-page #matches .tfp-result-card .tfp-result-set label {
  min-height: 16px;
}

#tfpMatchOptionsDialog {
  position: fixed;
  inset: 0;
  width: min(440px, calc(100% - 32px));
  height: fit-content;
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  box-sizing: border-box;
  margin: auto;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #aebed0;
  border-radius: 16px;
  background: #fff;
  color: #132b45;
  box-shadow: 0 16px 48px #081c2d40;
}

#tfpMatchOptionsDialog:not([open]) {
  display: none !important;
}

#tfpMatchOptionsDialog::backdrop {
  background: #0a1e3566;
}

html:has(#tfpMatchOptionsDialog[open]) {
  overflow: hidden;
}

#tfpMatchOptionsDialog > form {
  margin: 0;
}

#tfpMatchOptionsDialog .tfp-match-options-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#tfpMatchOptionsDialog h2 {
  margin: 0;
  color: #132b45;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
}

#tfpMatchOptionsDialog p {
  margin: 4px 0 0;
  color: #4f647a;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#tfpMatchOptionsDialog .tfp-match-options-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #dae3ee;
  border-radius: 9px;
  background: #f6f8fb;
  color: #203955;
  cursor: pointer;
}

#tfpMatchOptionsDialog .tfp-match-options-list {
  display: grid;
  border: 1px solid #d7e0ea;
  border-radius: 10px;
  overflow: hidden;
}

#tfpMatchOptionsDialog .tfp-match-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 42px 11px 13px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #132b45;
  font: inherit;
  line-height: 1.25;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

#tfpMatchOptionsDialog .tfp-match-option + .tfp-match-option {
  border-top: 1px solid #e1e8f0;
}

#tfpMatchOptionsDialog .tfp-match-option strong {
  font-size: 16px;
  font-weight: 700;
}

#tfpMatchOptionsDialog .tfp-match-option small {
  color: #4f647a;
  font-size: 13px;
}

#tfpMatchOptionsDialog .tfp-match-option[aria-pressed="true"],
#tfpMatchOptionsDialog .tfp-match-option:hover {
  background: #f6f2fd;
}

#tfpMatchOptionsDialog .tfp-match-option[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 17px;
  width: 12px;
  height: 6px;
  border: solid #6936c5;
  border-width: 0 0 2px 2px;
  transform: translateY(-75%) rotate(-45deg);
}

#tfpMatchOptionsDialog button:focus-visible,
body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-match-options-trigger:focus-visible {
  outline: 2px solid #6936c5 !important;
  outline-offset: -3px;
}

@media (max-width: 640px) {
  #tfpMatchOptionsDialog {
    inset: auto 0 0;
    width: 100%;
    margin: 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
  }
}

@media (max-width: 359px) {
  body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card {
    --tfp-match-inset: 10px;
  }

  body:is([data-page="tournament-view"], [data-page="league-view"]) #tfpCompetitionView.league-page #matches .tfp-result-card .league-match-player {
    padding-inline: 5px !important;
  }
}
