.league-matches-toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.league-search-box input {
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid #dbe6f7;
  background: rgba(255,255,255,.88);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  color: #132548;
  outline: none;
}

.league-search-box input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,.10);
}

.league-matches-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.league-match-card {
  border-radius: 16px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(246,249,255,.98) 100%);
  border: 1px solid #e4edfb;
  box-shadow: 0 10px 24px rgba(22,49,110,.05);
}

.league-match-card.is-played {
  border-color: rgba(59,130,246,.22);
}

.league-match-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.league-match-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.league-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 9px;
  font-weight: 800;
}

.league-badge.ok {
  background: rgba(22,163,74,.12);
  color: #15803d;
}

.league-badge.pending {
  background: rgba(245,158,11,.14);
  color: #b45309;
}

.league-match-score {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
}

.league-match-players-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.league-match-player {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.league-match-player strong {
  display: block;
  font-size: 12px;
  color: #142443;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-match-player--right {
  justify-content: flex-end;
}

.league-match-player--right strong {
  text-align: right;
}

.league-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  box-shadow: 0 0 0 4px rgba(59,130,246,.10);
  flex-shrink: 0;
}

.league-dot--alt {
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  box-shadow: 0 0 0 4px rgba(124,58,237,.08);
}

.league-match-vs {
  font-size: 9px;
  font-weight: 900;
  color: #64748b;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.league-sets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.league-set-box {
  border-radius: 12px;
  padding: 8px;
  background: #f8fbff;
  border: 1px solid #e7eefb;
}

.league-set-box label {
  display: block;
  margin-bottom: 6px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  color: #64748b;
}

.league-set-inputs {
  display: flex;
  gap: 6px;
}

.league-set-inputs input {
  width: 100%;
  height: 32px;
  border-radius: 9px;
  border: 1px solid #dce7f8;
  background: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  outline: none;
}

.league-set-inputs input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.10);
}

.league-save-btn {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #245ddb 0%, #1f9eea 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

@media (min-width: 860px) {
  .league-matches-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .league-matches-toolbar {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: center;
  }
}
.league-cancel-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.league-match-readonly {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid #e6eefb;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.league-match-form {
  margin: 0;
}

.league-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: stretch;
}

.league-match-actions > .league-save-btn,
.league-match-actions > .league-match-form--cancel {
  flex: 1 1 0;
  min-width: 0;
}

.league-save-btn--compact,
.league-cancel-btn--compact {
  width: 100%;
  margin-top: 0;
  min-height: 38px;
  padding: 9px 12px;
  font-size: 11px;
  border-radius: 10px;
}

.league-match-form--cancel .league-cancel-btn--compact {
  display: block;
}

@media (max-width: 560px) {
  .league-match-actions > .league-save-btn,
  .league-match-actions > .league-match-form--cancel {
    flex-basis: 100%;
  }
}

/* FINAL: clean tournament/league match cards - compact, readable, no vertical names */
body[data-page="tournament-view"] .league-matches-grid,
.tournament-page .league-matches-grid,
body[data-page="league-view"] .league-matches-grid,
.league-page .league-matches-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 860px) {
  body[data-page="tournament-view"] .league-matches-grid,
  .tournament-page .league-matches-grid,
  body[data-page="league-view"] .league-matches-grid,
  .league-page .league-matches-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body[data-page="tournament-view"] .league-match-card,
.tournament-page .league-match-card,
body[data-page="league-view"] .league-match-card,
.league-page .league-match-card {
  padding: 9px 10px !important;
  border-radius: 14px !important;
  background: #fff !important;
  border: 1px solid #dfe9f8 !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .045) !important;
  min-height: 0 !important;
}

body[data-page="tournament-view"] .league-match-top,
.tournament-page .league-match-top,
body[data-page="league-view"] .league-match-top,
.league-page .league-match-top {
  margin-bottom: 7px !important;
  gap: 6px !important;
}

body[data-page="tournament-view"] .league-badge,
.tournament-page .league-badge,
body[data-page="league-view"] .league-badge,
.league-page .league-badge {
  padding: 4px 7px !important;
  border-radius: 999px !important;
  font-size: 9px !important;
  line-height: 1 !important;
  font-weight: 850 !important;
}

body[data-page="tournament-view"] .league-match-players-row,
.tournament-page .league-match-players-row,
body[data-page="league-view"] .league-match-players-row,
.league-page .league-match-players-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 5px 0 8px !important;
}

body[data-page="tournament-view"] .league-match-player,
.tournament-page .league-match-player,
body[data-page="league-view"] .league-match-player,
.league-page .league-match-player {
  min-width: 0 !important;
  height: 32px !important;
  padding: 0 8px !important;
  border-radius: 10px !important;
  background: #f8fbff !important;
  border: 1px solid #e6eefb !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  overflow: hidden !important;
  writing-mode: horizontal-tb !important;
}

body[data-page="tournament-view"] .league-match-player--right,
.tournament-page .league-match-player--right,
body[data-page="league-view"] .league-match-player--right,
.league-page .league-match-player--right {
  justify-content: flex-end !important;
}

body[data-page="tournament-view"] .league-match-player strong,
.tournament-page .league-match-player strong,
body[data-page="league-view"] .league-match-player strong,
.league-page .league-match-player strong,
body[data-page="tournament-view"] .league-match-player a,
.tournament-page .league-match-player a,
body[data-page="league-view"] .league-match-player a,
.league-page .league-match-player a,
body[data-page="tournament-view"] .league-match-player .tfp-player-link,
.tournament-page .league-match-player .tfp-player-link,
body[data-page="tournament-view"] .league-match-player .tfp-pair-inline,
.tournament-page .league-match-player .tfp-pair-inline {
  min-width: 0 !important;
  max-width: 100% !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  writing-mode: horizontal-tb !important;
  font-size: 10.5px !important;
  line-height: 1.15 !important;
  font-weight: 850 !important;
  color: #174ea6 !important;
}

body[data-page="tournament-view"] .league-match-player--right strong,
.tournament-page .league-match-player--right strong,
body[data-page="league-view"] .league-match-player--right strong,
.league-page .league-match-player--right strong {
  justify-content: flex-end !important;
  text-align: right !important;
}

body[data-page="tournament-view"] .league-dot,
.tournament-page .league-dot,
body[data-page="league-view"] .league-dot,
.league-page .league-dot {
  width: 6px !important;
  height: 6px !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.10) !important;
  flex: 0 0 auto !important;
}

body[data-page="tournament-view"] .league-match-vs,
.tournament-page .league-match-vs,
body[data-page="league-view"] .league-match-vs,
.league-page .league-match-vs {
  justify-self: center !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center !important;
  background: #f0f6ff !important;
  color: #64748b !important;
  font-size: 8px !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
}

body[data-page="tournament-view"] .league-sets-grid,
.tournament-page .league-sets-grid,
body[data-page="league-view"] .league-sets-grid,
.league-page .league-sets-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

body[data-page="tournament-view"] .league-set-box,
.tournament-page .league-set-box,
body[data-page="league-view"] .league-set-box,
.league-page .league-set-box {
  padding: 6px !important;
  border-radius: 10px !important;
}

body[data-page="tournament-view"] .league-set-box label,
.tournament-page .league-set-box label,
body[data-page="league-view"] .league-set-box label,
.league-page .league-set-box label {
  font-size: 8px !important;
  margin-bottom: 4px !important;
}

body[data-page="tournament-view"] .league-set-inputs,
.tournament-page .league-set-inputs,
body[data-page="league-view"] .league-set-inputs,
.league-page .league-set-inputs {
  gap: 4px !important;
}

body[data-page="tournament-view"] .league-set-inputs input,
.tournament-page .league-set-inputs input,
body[data-page="league-view"] .league-set-inputs input,
.league-page .league-set-inputs input {
  height: 28px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  font-weight: 850 !important;
}

body[data-page="tournament-view"] .league-match-result-line,
.tournament-page .league-match-result-line,
body[data-page="league-view"] .league-match-result-line,
.league-page .league-match-result-line {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 6px 0 8px !important;
  padding: 6px 8px !important;
  border-radius: 10px !important;
  background: #f8fbff !important;
  border: 1px solid #e6eefb !important;
  color: #334155 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
}

body[data-page="tournament-view"] .league-match-result-line strong,
.tournament-page .league-match-result-line strong,
body[data-page="league-view"] .league-match-result-line strong,
.league-page .league-match-result-line strong {
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 950 !important;
}

body[data-page="tournament-view"] .league-save-btn,
.tournament-page .league-save-btn,
body[data-page="league-view"] .league-save-btn,
.league-page .league-save-btn {
  min-height: 32px !important;
  margin-top: 6px !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  font-size: 10.5px !important;
}

body[data-page="tournament-view"] .league-match-actions,
.tournament-page .league-match-actions,
body[data-page="league-view"] .league-match-actions,
.league-page .league-match-actions {
  gap: 6px !important;
  margin-top: 7px !important;
}

.tournament-referee-link--match-card {
  min-height: 28px !important;
  padding: 6px 10px !important;
  border-radius: 10px !important;
  font-size: 10px !important;
}

.tfp-pair-separator {
  color: #94a3b8 !important;
  font-weight: 950 !important;
  flex: 0 0 auto !important;
}

@media (max-width: 560px) {
  body[data-page="tournament-view"] .league-match-card,
  .tournament-page .league-match-card,
  body[data-page="league-view"] .league-match-card,
  .league-page .league-match-card {
    padding: 8px !important;
  }

  body[data-page="tournament-view"] .league-match-players-row,
  .tournament-page .league-match-players-row,
  body[data-page="league-view"] .league-match-players-row,
  .league-page .league-match-players-row {
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) !important;
    gap: 4px !important;
  }

  body[data-page="tournament-view"] .league-match-player,
  .tournament-page .league-match-player,
  body[data-page="league-view"] .league-match-player,
  .league-page .league-match-player {
    height: 30px !important;
    padding: 0 6px !important;
  }

  body[data-page="tournament-view"] .league-match-player strong,
  .tournament-page .league-match-player strong,
  body[data-page="league-view"] .league-match-player strong,
  .league-page .league-match-player strong,
  body[data-page="tournament-view"] .league-match-player a,
  .tournament-page .league-match-player a,
  body[data-page="tournament-view"] .league-match-player .tfp-pair-inline,
  .tournament-page .league-match-player .tfp-pair-inline {
    font-size: 9px !important;
    gap: 2px !important;
  }

  body[data-page="tournament-view"] .league-sets-grid,
  .tournament-page .league-sets-grid,
  body[data-page="league-view"] .league-sets-grid,
  .league-page .league-sets-grid {
    gap: 4px !important;
  }

  body[data-page="tournament-view"] .league-set-box,
  .tournament-page .league-set-box,
  body[data-page="league-view"] .league-set-box,
  .league-page .league-set-box {
    padding: 5px !important;
  }

  body[data-page="tournament-view"] .league-set-inputs input,
  .tournament-page .league-set-inputs input,
  body[data-page="league-view"] .league-set-inputs input,
  .league-page .league-set-inputs input {
    height: 27px !important;
    font-size: 10px !important;
  }
}

/* League match bridges: referee + coach */
.league-match-panel-links {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}
.league-panel-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.league-panel-link--coach {
  background: #f0fdf4;
  border-color: rgba(22, 163, 74, .18);
  color: #15803d;
}
.league-panel-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .14);
}

@media (max-width: 640px) {
  .league-match-top {
    align-items: flex-start;
    gap: 8px;
  }
  .league-match-panel-links {
    width: 100%;
    justify-content: stretch;
    margin-left: 0;
  }
  .league-panel-link {
    flex: 1 1 0;
    min-height: 28px;
    font-size: 10px;
    padding: 0 8px;
  }
}

/* TFP: szybkie filtry meczów w lidze — wszystkie / rozegrane / nierozegrane */
.league-matches-toolbar__filters {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.league-match-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.league-match-status-tab {
  appearance: none;
  border: 1px solid #dbe8ff;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  color: #19335f;
  border-radius: 999px;
  min-height: 34px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(24, 82, 180, .06);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.league-match-status-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, .36);
  box-shadow: 0 12px 22px rgba(24, 82, 180, .10);
}

.league-match-status-tab.active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #2563eb 0%, #12a5ef 100%);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .24);
}

.league-match-status-tab[data-match-filter="played"].active {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  box-shadow: 0 12px 26px rgba(22, 163, 74, .22);
}

.league-match-status-tab[data-match-filter="pending"].active {
  background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
  box-shadow: 0 12px 26px rgba(245, 158, 11, .22);
}

.league-match-status-tab span {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, .10);
  color: #2563eb;
  font-size: 10px;
  font-weight: 950;
}

.league-match-status-tab.active span {
  background: rgba(255,255,255,.22);
  color: #ffffff;
}

.league-match-card[hidden] {
  display: none !important;
}

.league-match-filter-empty {
  margin-top: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed #cfe0f8;
  background: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(241,247,255,.92) 100%);
  color: #557097;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

@media (min-width: 860px) {
  .league-matches-toolbar {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .league-matches-toolbar {
    gap: 10px;
  }

  .league-match-status-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .league-match-status-tab {
    padding: 8px 7px;
    min-height: 36px;
    font-size: 10px;
    gap: 5px;
  }

  .league-match-status-tab span {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    font-size: 9px;
  }
}

/* TFP PATCH — kompaktowa zakładka kończenia rundy */
.league-top-tab--owner {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
  color: #ffffff !important;
  border-color: rgba(249, 115, 22, .35) !important;
  box-shadow: 0 10px 22px rgba(249, 115, 22, .18);
}

.league-top-tab--owner.active {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
}

.league-section-head--round-manager {
  align-items: flex-start;
}

.league-round-manager-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr);
  gap: 16px;
  align-items: stretch;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(37, 99, 235, .14);
  background:
    radial-gradient(circle at 92% 10%, rgba(14, 165, 233, .20), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(132, 204, 22, .16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(244,249,255,.96));
  box-shadow: 0 18px 48px rgba(15, 23, 42, .08);
}

.league-round-manager-card__main {
  min-width: 0;
}

.league-round-manager-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, .10);
  color: #2563eb;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.league-round-manager-card h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: clamp(24px, 3vw, 36px);
  line-height: .98;
  letter-spacing: -.05em;
}

.league-round-manager-card p {
  max-width: 720px;
  margin: 0;
  color: #607087;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 750;
}

.league-round-manager-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  grid-column: 1 / -1;
}

.league-round-manager-stats div {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(37, 99, 235, .12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.league-round-manager-stats span {
  display: block;
  margin-bottom: 5px;
  color: #71819a;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.league-round-manager-stats strong {
  display: block;
  color: #0f172a;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -.04em;
}

.league-round-manager-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.league-round-manager-actions form {
  margin: 0;
}

.league-round-primary-btn,
.league-round-secondary-btn,
.league-round-small-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 0;
  font-size: 13px;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.league-round-primary-btn {
  background: linear-gradient(135deg, #2563eb 0%, #08b6d8 100%);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, .22);
}

.league-round-primary-btn:hover,
.league-round-secondary-btn:hover,
.league-round-small-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.league-round-primary-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.league-round-secondary-btn {
  background: #eef6ff;
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, .14);
}

.league-round-small-action {
  width: auto;
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f97316) !important;
  color: #ffffff !important;
  border: 0 !important;
  box-shadow: 0 10px 22px rgba(249, 115, 22, .18);
}

@media (max-width: 820px) {
  .league-round-manager-card {
    grid-template-columns: 1fr;
    padding: 14px;
    border-radius: 20px;
  }

  .league-round-manager-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .league-round-manager-stats div {
    padding: 9px 8px;
    border-radius: 14px;
  }

  .league-round-manager-stats strong {
    font-size: 18px;
  }

  .league-round-manager-actions {
    gap: 8px;
  }

  .league-round-small-action {
    width: 100%;
  }
}


/* TFP FINAL — nowoczesna sekcja Mecze: 3 kolumny desktop, kompakt mobile */
#matches.league-panel {
  --tfp-match-navy: #071a3b;
  --tfp-match-blue: #2563eb;
  --tfp-match-cyan: #06b6d4;
  --tfp-match-green: #16a34a;
  --tfp-match-orange: #f97316;
  --tfp-match-soft: #f4f8ff;
}

#matches .league-section-head {
  margin: 2px 0 10px !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 14px !important;
}

#matches .league-section-head h2 {
  margin: 0 !important;
  color: #071a3b !important;
  font-size: clamp(19px, 2vw, 26px) !important;
  line-height: 1.05 !important;
  letter-spacing: -.045em !important;
  font-weight: 950 !important;
}

#matches .league-section-head p {
  max-width: 720px !important;
  margin: 4px 0 0 !important;
  color: #687a96 !important;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
  font-weight: 750 !important;
}

#matches .league-round-tabs {
  margin: 0 0 10px !important;
  gap: 7px !important;
}

#matches .league-round-tab {
  min-height: 30px !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  font-size: 10.5px !important;
  font-weight: 950 !important;
}

#matches .league-matches-toolbar {
  margin: 0 0 14px !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 270px) !important;
  align-items: center !important;
  gap: 14px !important;
}

#matches .league-matches-toolbar__filters {
  display: grid !important;
  gap: 9px !important;
  min-width: 0 !important;
}

#matches .league-mini-tabs[data-group-tabs="matches"] {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  padding: 8px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(37, 99, 235, .12) !important;
  background: rgba(255,255,255,.82) !important;
  box-shadow: 0 10px 26px rgba(15, 35, 84, .055) !important;
}

#matches .league-mini-tabs[data-group-tabs="matches"] .league-mini-tab {
  min-height: 29px !important;
  padding: 7px 11px !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  border: 1px solid #dbe8ff !important;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%) !important;
  color: #15315c !important;
  box-shadow: none !important;
}

#matches .league-mini-tabs[data-group-tabs="matches"] .league-mini-tab.active {
  border-color: rgba(6, 182, 212, .40) !important;
  background: linear-gradient(135deg, #102a5b 0%, #214da8 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(23, 72, 171, .22) !important;
}

#matches .league-match-status-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
}

#matches .league-match-status-tab {
  min-height: 34px !important;
  padding: 8px 12px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(37, 99, 235, .12) !important;
  background: rgba(255,255,255,.90) !important;
  color: #18345f !important;
  font-size: 10.5px !important;
  font-weight: 950 !important;
  box-shadow: 0 10px 24px rgba(15, 35, 84, .06) !important;
}

#matches .league-match-status-tab.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb 0%, #12a5ef 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 14px 28px rgba(37,99,235,.23) !important;
}

#matches .league-match-status-tab[data-match-filter="played"].active {
  background: linear-gradient(135deg, #0f9f6e 0%, #22c55e 100%) !important;
}

#matches .league-match-status-tab[data-match-filter="pending"].active {
  background: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%) !important;
}

#matches .league-search-box input {
  height: 42px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(37, 99, 235, .14) !important;
  background: rgba(255,255,255,.92) !important;
  color: #0f2345 !important;
  padding: 0 15px !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  box-shadow: 0 12px 28px rgba(15, 35, 84, .07) !important;
}

#matches .league-search-box input::placeholder {
  color: #7586a1 !important;
}

#matches .league-card {
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 24px !important;
  border: 1px solid rgba(15, 35, 84, .10) !important;
  background: rgba(255,255,255,.88) !important;
  box-shadow: 0 24px 58px rgba(15,35,84,.08) !important;
}

#matches .league-card__head {
  padding: 13px 16px !important;
  min-height: 52px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
  background:
    radial-gradient(circle at 8% 50%, rgba(6,182,212,.28), transparent 25%),
    linear-gradient(135deg, #071a3b 0%, #123f8f 100%) !important;
  color: #ffffff !important;
}

#matches .league-card__head h3 {
  margin: 0 !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 9px !important;
  font-size: 15px !important;
  font-weight: 950 !important;
  letter-spacing: -.02em !important;
}

#matches .league-card__head h3::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4b455, #8fa33b);
  box-shadow: 0 0 0 6px rgba(212,180,85,.13);
}

#matches .league-card__head span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 27px !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.12) !important;
  border: 1px solid rgba(255,255,255,.17) !important;
  color: #eaf3ff !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  white-space: nowrap !important;
}

#matches .league-matches-grid {
  padding: 14px !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

@media (min-width: 760px) {
  #matches .league-matches-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1120px) {
  #matches .league-matches-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
}

#matches .league-match-card {
  position: relative !important;
  overflow: hidden !important;
  padding: 11px !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,250,255,.98)) !important;
  border: 1px solid rgba(37,99,235,.13) !important;
  box-shadow: 0 14px 32px rgba(15,35,84,.07) !important;
  min-height: 0 !important;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}

#matches .league-match-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  opacity: .95;
}

#matches .league-match-card:hover {
  transform: translateY(-2px) !important;
  border-color: rgba(37,99,235,.26) !important;
  box-shadow: 0 18px 40px rgba(15,35,84,.105) !important;
}

#matches .league-match-card.is-played::before {
  background: linear-gradient(90deg, #16a34a, #22c55e) !important;
}

#matches .league-match-top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 0 9px !important;
}

#matches .league-match-badges {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  min-width: 0 !important;
}

#matches .league-badge {
  min-height: 25px !important;
  padding: 6px 8px !important;
  border-radius: 999px !important;
  font-size: 9px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  letter-spacing: .01em !important;
  background: #eef5ff !important;
  color: #2563eb !important;
  border: 1px solid rgba(37,99,235,.10) !important;
}

#matches .league-badge.ok {
  background: rgba(22, 163, 74, .12) !important;
  color: #15803d !important;
  border-color: rgba(22, 163, 74, .18) !important;
}

#matches .league-badge.pending {
  background: rgba(245, 158, 11, .15) !important;
  color: #b45309 !important;
  border-color: rgba(245, 158, 11, .22) !important;
}

#matches .league-match-panel-links {
  display: inline-flex !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  margin-left: 0 !important;
  width: auto !important;
}

#matches .league-panel-link {
  min-height: 25px !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  font-size: 9.5px !important;
  font-weight: 950 !important;
  box-shadow: none !important;
}

#matches .league-match-players-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) !important;
  gap: 7px !important;
  align-items: stretch !important;
  margin: 0 0 9px !important;
}

#matches .league-match-player {
  min-height: 38px !important;
  height: auto !important;
  padding: 7px 8px !important;
  border-radius: 13px !important;
  background: rgba(244,248,255,.92) !important;
  border: 1px solid rgba(37, 99, 235, .12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8) !important;
}

#matches .league-match-player strong,
#matches .league-match-player a,
#matches .league-match-player .tfp-player-link {
  color: #0f2b5e !important;
  font-size: 10.5px !important;
  line-height: 1.15 !important;
  font-weight: 950 !important;
}

#matches .league-match-player.is-win {
  border-color: rgba(22, 163, 74, .22) !important;
  background: rgba(240, 253, 244, .92) !important;
}

#matches .league-match-player.is-loss {
  opacity: .76 !important;
}

#matches .league-dot {
  width: 7px !important;
  height: 7px !important;
  box-shadow: 0 0 0 4px rgba(37,99,235,.10) !important;
}

#matches .league-match-vs {
  align-self: center !important;
  justify-self: center !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  background: #eef5ff !important;
  border: 1px solid #dbe8ff !important;
  color: #6a7890 !important;
  font-size: 8px !important;
  font-weight: 950 !important;
}

#matches .league-sets-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

#matches .league-set-box {
  padding: 7px !important;
  border-radius: 13px !important;
  background: #f7fbff !important;
  border: 1px solid #e1ebf8 !important;
}

#matches .league-set-box label {
  margin-bottom: 5px !important;
  color: #64748b !important;
  font-size: 8px !important;
  font-weight: 950 !important;
  letter-spacing: .03em !important;
}

#matches .league-set-inputs {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 5px !important;
}

#matches .league-set-inputs input {
  height: 30px !important;
  border-radius: 10px !important;
  border: 1px solid #dce8f8 !important;
  background: #ffffff !important;
  color: #071a3b !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  text-align: center !important;
}

#matches .league-match-played-board {
  display: grid !important;
  gap: 6px !important;
  margin: 0 0 9px !important;
  padding: 8px !important;
  border-radius: 15px !important;
  background:
    radial-gradient(circle at 100% 0%, rgba(34,197,94,.12), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 100%) !important;
  border: 1px solid rgba(37,99,235,.12) !important;
}

#matches .league-match-played-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 28px repeat(3, 24px) !important;
  align-items: center !important;
  gap: 5px !important;
  min-height: 32px !important;
}

#matches .league-match-played-name {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #233555 !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

#matches .league-match-played-row.is-winner .league-match-played-name {
  color: #0f7b43 !important;
}

#matches .league-match-played-sets {
  display: inline-grid !important;
  place-items: center !important;
  height: 26px !important;
  border-radius: 9px !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
  font-size: 13px !important;
  font-weight: 950 !important;
}

#matches .league-match-played-row.is-winner .league-match-played-sets {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
}

#matches .league-match-played-set {
  display: inline-grid !important;
  place-items: center !important;
  height: 24px !important;
  border-radius: 8px !important;
  background: #eef5ff !important;
  color: #0f2b5e !important;
  font-size: 11px !important;
  font-weight: 900 !important;
}

#matches .league-match-card.is-played .league-match-players-row {
  display: none !important;
}

#matches .league-match-card.is-played:not(.is-editing-result) .league-match-form--played-edit,
#matches .league-match-card.is-played:not(.is-editing-result) .league-save-btn--edit-save {
  display: none !important;
}

#matches .league-match-card.is-played.is-editing-result .league-match-form--played-edit {
  display: block !important;
  margin-top: 8px !important;
}

#matches .league-match-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px !important;
  margin-top: 9px !important;
}

#matches .league-match-card:not(.is-played) .league-match-actions {
  grid-template-columns: 1fr !important;
}

#matches .league-save-btn,
#matches .league-cancel-btn,
#matches .league-edit-result-btn {
  width: 100% !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 9px 10px !important;
  border: 0 !important;
  border-radius: 12px !important;
  font-size: 10.5px !important;
  font-weight: 950 !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

#matches .league-save-btn {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(37,99,235,.22) !important;
}

#matches .league-edit-result-btn {
  background: #eef5ff !important;
  color: #2563eb !important;
  border: 1px solid rgba(37,99,235,.14) !important;
}

#matches .league-cancel-btn {
  background: #fff1f2 !important;
  color: #e11d48 !important;
  border: 1px solid rgba(225,29,72,.14) !important;
  box-shadow: none !important;
}

#matches .league-match-form--cancel {
  margin: 0 !important;
}

#matches .league-match-result-pretty--readonly {
  margin-top: 8px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(37,99,235,.12) !important;
  background: #f8fbff !important;
}

#matches .league-empty-group-card,
#matches .league-match-filter-empty {
  margin: 14px !important;
  padding: 16px !important;
  border-radius: 18px !important;
  border: 1px dashed rgba(37,99,235,.22) !important;
  background: #f8fbff !important;
  color: #557097 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  text-align: center !important;
}

@media (max-width: 900px) {
  #matches .league-matches-toolbar {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  #matches .league-search-box {
    order: -1 !important;
  }
}

@media (max-width: 640px) {
  #matches .league-section-head {
    margin-bottom: 8px !important;
  }

  #matches .league-section-head h2 {
    font-size: 18px !important;
  }

  #matches .league-section-head p {
    font-size: 10.5px !important;
  }

  #matches .league-mini-tabs[data-group-tabs="matches"] {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 6px !important;
    overflow: hidden !important;
  }

  #matches .league-mini-tabs[data-group-tabs="matches"] .league-mini-tab {
    padding: 7px 6px !important;
    font-size: 9px !important;
    min-width: 0 !important;
  }

  #matches .league-match-status-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  #matches .league-match-status-tab {
    min-height: 34px !important;
    padding: 7px 5px !important;
    font-size: 9px !important;
    gap: 4px !important;
  }

  #matches .league-matches-grid {
    padding: 10px !important;
    gap: 10px !important;
  }

  #matches .league-card {
    border-radius: 20px !important;
  }

  #matches .league-card__head {
    min-height: 48px !important;
    padding: 11px 12px !important;
  }

  #matches .league-card__head h3 {
    font-size: 14px !important;
  }

  #matches .league-match-card {
    border-radius: 17px !important;
    padding: 10px !important;
  }

  #matches .league-match-top {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  #matches .league-match-panel-links {
    width: 100% !important;
    justify-content: stretch !important;
  }

  #matches .league-panel-link {
    flex: 1 1 0 !important;
    min-height: 29px !important;
    font-size: 9.5px !important;
  }

  #matches .league-match-players-row {
    grid-template-columns: 1fr 22px 1fr !important;
    gap: 5px !important;
  }

  #matches .league-match-player {
    min-height: 34px !important;
    padding: 6px !important;
  }

  #matches .league-match-player strong,
  #matches .league-match-player a,
  #matches .league-match-player .tfp-player-link {
    font-size: 9.5px !important;
  }

  #matches .league-sets-grid {
    gap: 5px !important;
  }

  #matches .league-set-box {
    padding: 6px 5px !important;
  }

  #matches .league-set-inputs input {
    height: 29px !important;
    font-size: 11px !important;
  }

  #matches .league-match-actions {
    grid-template-columns: 1fr !important;
  }

  #matches .league-match-played-row {
    grid-template-columns: minmax(0, 1fr) 26px repeat(3, 22px) !important;
    gap: 4px !important;
  }

  #matches .league-match-played-name {
    font-size: 10px !important;
  }

  #matches .league-match-played-set {
    height: 22px !important;
    font-size: 10px !important;
  }
}
