/* TennisFinalsPro - nowoczesna zakładka Wyniki ligi */

.league-results-toolbar {
  margin: 12px 0 14px;
}

.league-results-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(189, 209, 236, 0.9);
  border-radius: 22px;
  box-shadow: 0 22px 56px rgba(15, 35, 74, 0.12);
  overflow: hidden;
  position: relative;
}

.league-results-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #0f2f6f, #1677ff, #22d3ee);
  pointer-events: none;
}

.league-results-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(210, 224, 244, 0.9);
  background:
    radial-gradient(circle at 4% 0%, rgba(37, 99, 235, 0.12), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.league-results-card__head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0b63ff;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.league-results-card__head span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.12);
}

.league-results-card__head strong {
  display: block;
  margin-top: 5px;
  color: #061a3f;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.league-results-card__head p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid rgba(191, 219, 254, 0.95);
  border-radius: 999px;
  background: #eef6ff;
  color: #12366f;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.league-results-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.league-results-scroll::-webkit-scrollbar {
  height: 9px;
}

.league-results-scroll::-webkit-scrollbar-track {
  background: #edf5ff;
  border-radius: 999px;
}

.league-results-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  border-radius: 999px;
}

.league-results-matrix {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.league-results-matrix th,
.league-results-matrix td {
  border-right: 1px solid rgba(215, 226, 242, 0.95);
  border-bottom: 1px solid rgba(215, 226, 242, 0.95);
  padding: 14px 16px;
  vertical-align: middle;
  white-space: nowrap;
}

.league-results-matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #102f6c 0%, #071f4e 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  letter-spacing: -0.01em;
}

.league-results-matrix thead th span,
.league-results-player a,
.league-results-player span {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
  text-decoration: none;
}

.league-results-matrix thead th a,
.league-results-matrix thead th span {
  color: #ffffff;
}

.league-results-matrix thead th a:hover,
.league-results-player a:hover {
  color: #0b73ff;
}

.league-results-corner,
.league-results-player {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  box-shadow: 12px 0 24px rgba(15, 23, 42, 0.07);
}

.league-results-corner {
  z-index: 4;
  background: linear-gradient(180deg, #08275c 0%, #061a3f 100%) !important;
  color: #ffffff;
  min-width: 180px;
}

.league-results-player {
  min-width: 180px;
  max-width: 220px;
  background: linear-gradient(90deg, #ffffff 0%, #f6faff 100%);
  color: #0b63ff;
  font-size: 14px;
  font-weight: 950;
}

.league-results-matrix tbody tr:nth-child(even) td:not(.league-results-cell--self),
.league-results-matrix tbody tr:nth-child(even) .league-results-player {
  background-color: #f7fbff;
}

.league-results-cell {
  min-width: 120px;
  text-align: center;
  color: #102044;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -0.02em;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.league-results-cell.is-win {
  background: linear-gradient(180deg, #e8fff3, #d9fbe9);
  color: #007a3d;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.13);
}

.league-results-cell.is-loss {
  background: linear-gradient(180deg, #fff0f2, #ffe3e8);
  color: #c20035;
  box-shadow: inset 0 0 0 1px rgba(244, 63, 94, 0.13);
}

.league-results-cell.is-empty,
.league-results-cell--self {
  background: #f4f7fb;
  color: #8aa0bd;
}

.league-results-cell--self span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e8eef7;
  color: #7488a8;
}

.league-results-matrix tbody tr:hover .league-results-player,
.league-results-matrix tbody tr:hover td {
  background-image: linear-gradient(0deg, rgba(14, 116, 255, 0.07), rgba(14, 116, 255, 0.07));
}

.league-results-matrix tbody tr:hover .league-results-cell.is-win {
  background-image: linear-gradient(0deg, rgba(16, 185, 129, 0.06), rgba(16, 185, 129, 0.06));
}

.league-results-matrix tbody tr:hover .league-results-cell.is-loss {
  background-image: linear-gradient(0deg, rgba(244, 63, 94, 0.06), rgba(244, 63, 94, 0.06));
}

.league-results-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(215, 226, 242, 0.75);
  background: #ffffff;
  color: #566b8c;
  font-size: 13px;
  font-weight: 800;
}

.league-results-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.league-results-legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #d7e0ed;
}

.league-results-legend i.is-win {
  background: #10b981;
}
.league-results-legend i.is-loss {
  background: #f43f5e;
}
.league-results-legend i.is-self {
  background: #8aa0bd;
}
.league-results-legend i.is-empty {
  background: #cbd5e1;
}

@media (min-width: 980px) {
  .league-results-matrix thead th span,
  .league-results-player a,
  .league-results-player span {
    max-width: 210px;
  }

  .league-results-player {
    min-width: 210px;
    font-size: 15px;
  }

  .league-results-cell {
    min-width: 134px;
    font-size: 15px;
  }
}

@media (max-width: 720px) {
  .league-results-toolbar {
    margin: 10px 0 12px;
  }

  .league-results-card {
    border-radius: 18px;
  }

  .league-results-card__head {
    align-items: flex-start;
    flex-direction: column;
    padding: 15px;
    gap: 10px;
  }

  .league-results-card__head p {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    font-size: 12px;
  }

  .league-results-matrix {
    font-size: 13px;
  }

  .league-results-matrix th,
  .league-results-matrix td {
    padding: 12px 12px;
  }

  .league-results-corner,
  .league-results-player {
    min-width: 145px;
    max-width: 160px;
  }

  .league-results-player {
    font-size: 13px;
  }

  .league-results-cell {
    min-width: 94px;
    font-size: 13px;
  }

  .league-results-legend {
    font-size: 12px;
    padding: 12px 14px 15px;
  }
}

/* TFP hotfix: mocniejszy kontrast nagłówków i nazwisk w macierzy wyników */
.league-results-matrix thead th,
.league-results-matrix thead th * {
  color: #f8fbff !important;
  opacity: 1 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
}

.league-results-matrix thead th {
  background: linear-gradient(180deg, #123d87 0%, #061b42 100%) !important;
  border-right-color: rgba(129, 180, 255, 0.32) !important;
  border-bottom-color: rgba(129, 180, 255, 0.42) !important;
  font-size: 13px !important;
  letter-spacing: 0.01em !important;
}

.league-results-corner,
.league-results-corner * {
  color: #ffffff !important;
  opacity: 1 !important;
}

.league-results-corner {
  background: linear-gradient(180deg, #082d70 0%, #061735 100%) !important;
  text-transform: uppercase;
  letter-spacing: 0.065em !important;
  font-weight: 950 !important;
}

.league-results-matrix thead th a,
.league-results-matrix thead th span {
  color: #ffffff !important;
  font-weight: 950 !important;
  text-decoration: none !important;
}

.league-results-matrix thead th a:hover {
  color: #bde7ff !important;
}

.league-results-player,
.league-results-player a,
.league-results-player span {
  color: #005fec !important;
  opacity: 1 !important;
  font-weight: 950 !important;
}

.league-results-player a:hover {
  color: #003f9f !important;
}

.league-results-card__head span,
.league-results-card__head strong {
  color: #061a3f !important;
}

.league-results-card__head > div > span {
  color: #0b63ff !important;
}

.league-results-card__head p {
  color: #0a2a62 !important;
}

.league-results-cell.is-win {
  color: #006b38 !important;
  background: linear-gradient(180deg, #dcfce7 0%, #c8f7db 100%) !important;
}

.league-results-cell.is-loss {
  color: #be123c !important;
  background: linear-gradient(180deg, #ffe4e6 0%, #ffd5db 100%) !important;
}

.league-results-cell.is-empty,
.league-results-cell--self {
  color: #667a9a !important;
}

@media (max-width: 720px) {
  .league-results-matrix thead th {
    font-size: 12px !important;
  }

  .league-results-player,
  .league-results-player a,
  .league-results-player span {
    font-size: 13px !important;
  }
}

/* TFP 2026: czytelniejsze nazwiska i bardziej kompaktowa macierz wyników */
@media (min-width: 721px) {
  body[data-page="league-view"] #results .league-results-player,
  body[data-page="league-view"] #results .league-results-player a,
  body[data-page="league-view"] #results .league-results-player span {
    font-size: 16px !important;
    line-height: 1.25 !important;
    font-weight: 950 !important;
    letter-spacing: -0.018em !important;
  }

  body[data-page="league-view"] #results .league-results-matrix thead th:not(.league-results-corner),
  body[data-page="league-view"] #results .league-results-matrix thead th:not(.league-results-corner) a,
  body[data-page="league-view"] #results .league-results-matrix thead th:not(.league-results-corner) span {
    font-size: 12px !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 720px) {
  body[data-page="league-view"] #results .league-results-card__head {
    padding: 13px 12px 11px !important;
  }

  body[data-page="league-view"] #results .league-results-card__head strong {
    font-size: 19px !important;
  }

  body[data-page="league-view"] #results .league-results-matrix th,
  body[data-page="league-view"] #results .league-results-matrix td {
    padding: 9px 8px !important;
  }

  body[data-page="league-view"] #results .league-results-corner,
  body[data-page="league-view"] #results .league-results-player {
    min-width: 132px !important;
    width: 132px !important;
    max-width: 132px !important;
  }

  body[data-page="league-view"] #results .league-results-player,
  body[data-page="league-view"] #results .league-results-player a,
  body[data-page="league-view"] #results .league-results-player span {
    font-size: 13.5px !important;
    line-height: 1.2 !important;
    font-weight: 950 !important;
  }

  body[data-page="league-view"] #results .league-results-matrix thead th:not(.league-results-corner),
  body[data-page="league-view"] #results .league-results-matrix thead th:not(.league-results-corner) a,
  body[data-page="league-view"] #results .league-results-matrix thead th:not(.league-results-corner) span {
    max-width: 82px !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
  }

  body[data-page="league-view"] #results .league-results-cell {
    min-width: 82px !important;
    width: 82px !important;
    font-size: 12px !important;
  }

  body[data-page="league-view"] #results .league-results-cell--self span {
    width: 21px !important;
    height: 21px !important;
  }

  body[data-page="league-view"] #results .league-results-legend {
    gap: 8px 11px !important;
    padding: 11px 12px 13px !important;
    font-size: 11px !important;
  }
}

/* =========================================================
   TFP PATCH: spokojniejsze nazwiska w Wynikach ligi
   - czarny, lżejszy tekst
   - profil z kontem: hover wyłącznie kolorem
   - bez obwódek / podświetlania całego wiersza
   ========================================================= */
body[data-page="league-view"] #results .league-results-player,
body[data-page="league-view"] #results .league-results-player .tfp-player-link,
body[data-page="league-view"] #results .league-results-player > a,
body[data-page="league-view"] #results .league-results-player > span {
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -0.008em !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
}

body[data-page="league-view"] #results .league-results-player a.tfp-player-link,
body[data-page="league-view"] #results .league-results-player > a {
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  color: #111827 !important;
  font-weight: 600 !important;
  transition: color .16s ease !important;
}

body[data-page="league-view"] #results .league-results-player a.tfp-player-link:hover,
body[data-page="league-view"] #results .league-results-player a.tfp-player-link:focus-visible,
body[data-page="league-view"] #results .league-results-player > a:hover,
body[data-page="league-view"] #results .league-results-player > a:focus-visible {
  color: #3b82f6 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
}

body[data-page="league-view"] #results .league-results-matrix tbody tr:hover .league-results-player,
body[data-page="league-view"] #results .league-results-matrix tbody tr:hover td,
body[data-page="league-view"] #results .league-results-matrix tbody tr:hover .league-results-cell.is-win,
body[data-page="league-view"] #results .league-results-matrix tbody tr:hover .league-results-cell.is-loss {
  box-shadow: none !important;
}

body[data-page="league-view"] #results .league-results-matrix thead th:not(.league-results-corner),
body[data-page="league-view"] #results .league-results-matrix thead th:not(.league-results-corner) a,
body[data-page="league-view"] #results .league-results-matrix thead th:not(.league-results-corner) span {
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
}

@media (min-width: 721px) {
  body[data-page="league-view"] #results .league-results-player,
  body[data-page="league-view"] #results .league-results-player a,
  body[data-page="league-view"] #results .league-results-player span {
    font-size: 14.5px !important;
    font-weight: 600 !important;
    letter-spacing: -0.008em !important;
  }
}
