:root,
[data-bs-theme="light"] {
  --datatable-header-color: #212529;
}

[data-bs-theme="dark"] {
  --datatable-header-color: #ffffff;
}

table.dataTable thead th {
  background: none !important;
  color: var(--datatable-header-color) !important;
  border: none !important;
}

.logo-container.big {
  width: 100px;
  height: 100px;
}

.table > :not(caption) > * > * {
  padding: 1rem !important;
}

div.table-responsive > div.dataTables_wrapper > div.row {
  margin: 0.5rem 0 !important;
}

.btn-action-icon {
  min-height: 30px;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1;
}

.dataTable td,
.dataTable th {
  vertical-align: middle !important;
}

.tournament-place-field:not(.tournament-ranking-place) input[type="text"] {
  max-width: 30px !important;
}

.errorlist {
  margin: 0 !important;
}

.asteriskField {
  color: var(--bs-danger);
  margin-left: 0.15rem;
}

#div_id_captcha .captcha {
  display: block;
  height: auto;
  margin-bottom: 0.5rem;
  min-width: 180px;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
.was-validated .form-control:invalid:focus,
.was-validated .form-select:invalid:focus {
  border-color: var(--bs-danger);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-danger-rgb), 0.25);
}

/*
Tournaments classes
*/
.tournament_goes_to_rating td {
  background-color: #f6fefa !important;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.06);
  transition:
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.tournament_goes_to_rating td:first-child {
  box-shadow:
    inset 3px 0 0 #34d399,
    inset 0 -1px 0 rgba(15, 23, 42, 0.06);
}

.tournament_goes_to_rating:hover td {
  background-color: #ecfdf5 !important;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.08);
}

.tournament_goes_to_rating:hover td:first-child {
  box-shadow:
    inset 3px 0 0 #10b981,
    inset 0 -1px 0 rgba(15, 23, 42, 0.08);
}

.tournament_away td {
  background: rgba(var(--bs-primary-rgb), 0.07) !important;
  border: rgba(var(--bs-primary-rgb), 0.07) !important;
}

.tournament_b td {
  background: rgba(var(--bs-secondary-rgb), 0.07) !important;
  border: rgba(var(--bs-secondary-rgb), 0.07) !important;
}

.tournament-name {
  overflow: hidden;
}

.tournament-name a {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* table-layout: fixed is required for text-overflow to work inside DataTables */
#tournaments {
  table-layout: fixed !important;
}

/* Shared tournament badges and the legacy tag class on player history. */

/*
Athletes ranking page
*/

.players-table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 !important;
  table-layout: fixed;
  width: 100% !important;
}

.players-table th {
  background: #fbfdff !important;
  border-bottom: 1px solid #dbe5ef !important;
  color: #23304a !important;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.9rem 1rem !important;
  position: relative;
  text-align: left;
  white-space: nowrap;
}

.players-table th.sorting,
.players-table th.sorting_asc,
.players-table th.sorting_desc {
  padding-right: 1.7rem !important;
}

.players-table th.sorting::before,
.players-table th.sorting_asc::before,
.players-table th.sorting_desc::before,
.players-table th.sorting::after,
.players-table th.sorting_asc::after,
.players-table th.sorting_desc::after {
  content: "";
  height: 0;
  opacity: 1;
  position: absolute;
  right: 0.78rem;
  width: 0;
}

.players-table th.sorting::before,
.players-table th.sorting_asc::before,
.players-table th.sorting_desc::before {
  border-bottom: 4px solid #bdc7d3;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  top: calc(50% - 5px);
}

.players-table th.sorting::after,
.players-table th.sorting_asc::after,
.players-table th.sorting_desc::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #bdc7d3;
  top: calc(50% + 2px);
}

.players-table th.sorting_asc::after,
.players-table th.sorting_desc::before {
  display: none;
}

table.dataTable.players-table thead th.sorting_asc::after,
table.dataTable.players-table thead td.sorting_asc::after,
table.dataTable.players-table thead th.sorting_desc::before,
table.dataTable.players-table thead td.sorting_desc::before {
  content: "" !important;
  display: none !important;
}

.players-table th.sorting_asc::before,
.players-table th.sorting_desc::after {
  top: calc(50% - 2px);
}

.players-table th.sorting_asc::before {
  border-bottom-color: #1f5f8b;
}

.players-table th.sorting_desc::after {
  border-top-color: #1f5f8b;
}

table.dataTable.players-table thead th.sorting::before,
table.dataTable.players-table thead th.sorting_asc::before,
table.dataTable.players-table thead th.sorting_desc::before,
table.dataTable.players-table thead th.sorting::after,
table.dataTable.players-table thead th.sorting_asc::after,
table.dataTable.players-table thead th.sorting_desc::after {
  content: "" !important;
}

.players-table th.sorting_disabled::before,
.players-table th.sorting_disabled::after {
  display: none;
}

.players-table th:first-child,
.players-table td:first-child {
  padding-left: 1.65rem !important;
}

.players-table th:last-child,
.players-table td:last-child {
  padding-right: 1.25rem !important;
}

.players-table td {
  border-bottom: 1px solid #e5ecf4;
  color: #23304a;
  font-size: 0.9rem;
  padding: 0.78rem 1rem !important;
  vertical-align: middle;
}

.players-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (min-width: 768px) and (max-width: 1199.98px),
  (min-width: 768px) and (max-width: 1400px) and (pointer: coarse) {
  .players-results-surface {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .players-table-responsive {
    overflow: visible;
  }

  .players-table,
  .players-table thead,
  .players-table tbody,
  .players-table tr,
  .players-table td {
    display: block;
    width: 100%;
  }

  .players-table thead {
    display: none;
  }

  .players-table tbody {
    display: grid;
    gap: 0.9rem;
  }

  .players-table tr.players-row {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: block !important;
    gap: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    position: static !important;
  }

  .players-table tr.players-row::before {
    display: none !important;
  }

  .players-table tr.players-row > td {
    display: none !important;
  }

  .players-table tr.players-row > td.players-mobile-card-cell {
    display: block !important;
    padding: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 767.98px) {

  .players-results-surface {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .players-table-responsive {
    overflow: visible;
  }

  .players-table,
  .players-table thead,
  .players-table tbody,
  .players-table tr,
  .players-table td {
    display: block;
    width: 100%;
  }

  .players-table thead {
    display: none;
  }

  .players-table tbody {
    display: grid;
    gap: 0.9rem;
  }

  .players-table tr.players-row {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: block !important;
    gap: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    position: static !important;
  }

  .players-table tr.players-row::before {
    display: none !important;
  }

  .players-table tr.players-row > td {
    display: none !important;
  }

  .players-table tr.players-row > td.players-mobile-card-cell {
    display: block !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .players-rank-cell {
    align-self: start;
    grid-area: rank;
    justify-self: end;
    padding-top: 0.02rem !important;
  }

  .players-rank-badge {
    background: rgba(237, 249, 241, 0.94);
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    box-shadow:
      0 8px 20px rgba(15, 143, 77, 0.12),
      inset 0 0 0 1px rgba(17, 155, 89, 0.08);
    color: #119b59;
    flex-direction: column;
    gap: 0.02rem;
    height: 3.35rem;
    min-height: 3.35rem;
    min-width: 3.35rem;
    padding: 0.34rem 0.25rem;
    width: 3.35rem;
  }

  .players-rank-value {
    font-size: 1.3rem;
    font-weight: 800;
  }

  .players-rank-label-mobile {
    color: #08264a;
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.05;
    white-space: nowrap;
  }

  .players-athlete-cell {
    grid-area: athlete;
    min-width: 0;
  }

  .players-athlete-link {
    align-items: flex-start;
    gap: 0.75rem;
  }

  .players-athlete-avatar {
    border: 3px solid rgba(255, 255, 255, 0.92);
    box-shadow:
      0 12px 24px rgba(15, 45, 75, 0.12),
      inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    height: 4.75rem;
    width: 4.75rem;
  }

  .players-athlete-avatar-placeholder {
    font-size: 2.55rem;
  }

  .players-athlete-copy {
    gap: 0.26rem;
    padding-top: 0.04rem;
  }

  .players-athlete-name {
    display: -webkit-box;
    font-size: 1.95rem;
    font-weight: 800;
    line-height: 1.08;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .players-athlete-meta-mobile {
    color: #2f5d7c;
    display: grid;
    font-size: 0.82rem;
    font-weight: 700;
    gap: 0.12rem;
    line-height: 1.2;
    min-width: 0;
  }

  .players-athlete-meta-line {
    align-items: center;
    display: flex;
    gap: 0.2rem;
    min-width: 0;
  }

  .players-athlete-meta-line .bi {
    color: #475467;
    flex: 0 0 auto;
    font-size: 0.95rem;
  }

  .players-athlete-country {
    align-items: center;
    display: inline-flex;
    gap: 0.16rem;
    min-width: 0;
    white-space: nowrap;
  }

  .players-athlete-country .flag-icon {
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(15, 45, 75, 0.08);
    margin-left: 0.08rem;
  }

  .players-points-cell {
    grid-area: points;
  }

  .players-power-cell {
    grid-area: power;
  }

  .players-metric-badge {
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 45, 75, 0.06);
    box-shadow: 0 -6px 18px rgba(15, 45, 75, 0.04);
    display: grid !important;
    gap: 0.45rem;
    grid-template-columns: 1.72rem minmax(0, 1fr);
    justify-content: start;
    min-height: 3.22rem;
    min-width: 0;
    padding: 0.68rem 0.62rem;
    width: 100%;
  }

  .players-points-badge {
    border-radius: 16px 0 0 16px;
  }

  .players-power-badge {
    border-left: 1px solid rgba(15, 45, 75, 0.08);
    border-radius: 0 16px 16px 0;
  }

  .players-metric-badge i {
    align-items: center;
    background: #e9f5ff;
    border-radius: 999px;
    color: #2563eb;
    display: inline-flex;
    font-size: 0.9rem;
    height: 1.72rem;
    justify-content: center;
    width: 1.72rem;
  }

  .players-power-badge i {
    background: #e6faff;
    color: #13aee8;
  }

  .players-metric-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
  }

  .players-metric-value {
    color: #08264a;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.08;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .players-metric-label {
    color: #5f7285;
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.12;
  }

  .players-license-cell {
    grid-area: license;
  }

  .players-sex-cell {
    grid-area: sex;
  }

  .players-age-cell {
    grid-area: age;
  }

  .players-license-badge,
  .players-sex-badge,
  .players-age-badge {
    align-items: center;
    border-radius: 12px;
    display: grid !important;
    gap: 0.36rem;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: start;
    min-height: 3rem;
    min-width: 0;
    padding: 0.58rem 0.42rem;
    width: 100%;
  }

  .players-license-badge {
    background: #f5f7f9;
    border-color: #e5e9ef;
    color: #08264a;
  }

  .players-license-badge i {
    color: #6b7280;
    transform: none;
  }

  .players-license-copy {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
  }

  .players-license-number {
    color: #08264a;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.08;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .players-license-label {
    color: #5f7285;
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.1;
  }

  .players-sex-badge {
    background: #fffaf0 !important;
    border-color: #f1dfb8 !important;
    color: #08264a !important;
  }

  .players-sex-badge i {
    color: #d38d00;
  }

  .players-sex-copy {
    display: grid;
    gap: 0.16rem;
    min-width: 0;
  }

  .players-sex-value {
    color: #08264a;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.08;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .players-sex-label {
    color: #5f7285;
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.1;
  }

  .players-age-badge {
    background: #fffaf0;
    border: 1px solid #f1dfb8;
  }

  .players-age-icon {
    color: #d9a000;
    display: inline-flex;
    font-size: 0.9rem;
    line-height: 1;
  }

  .players-age-badge .badge {
    background: transparent !important;
    border: 0 !important;
    color: #08264a !important;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.08;
    min-width: 0;
    padding: 0 !important;
  }

  .players-age-label {
    color: #5f7285;
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.1;
    margin-top: 0.16rem;
  }

  .players-license-badge-missing {
    display: flex !important;
    justify-content: center;
  }

  .players-metric-badge,
  .players-sex-badge,
  .players-age-badge,
  .players-license-badge {
    min-width: 0;
    width: 100%;
  }

  .players-table td {
    border: 0;
    padding: 0 !important;
  }

  .players-metric-copy,
  .players-sex-copy,
  .players-license-copy {
    align-items: start;
  }

  .players-sex-badge-f i {
    color: #c23a7a;
  }

  .players-no-club {
    width: 100%;
  }

  .players-row.inactive::before {
    opacity: 0.65;
  }

  .players-row.inactive {
    opacity: 1;
  }

  .players-row.inactive td {
    opacity: 0.85;
  }

  .players-row:hover {
    background: #ffffff;
  }

  .players-rank-cell,
  .players-athlete-cell,
  .players-points-cell,
  .players-power-cell,
  .players-license-cell,
  .players-sex-cell,
  .players-age-cell {
    border: 0 !important;
  }

  .players-club-wrap {
    align-items: flex-start;
  }

  .players-athlete-meta-line:first-child {
    margin-top: 0.04rem;
  }

  .players-athlete-meta-line:last-child {
    font-weight: 650;
  }

  .players-license-badge-missing {
    padding-inline: 0.6rem;
  }

  .players-license-badge-missing .players-license-label {
    display: none;
  }

  .players-license-badge-missing,
  .players-no-club {
    font-size: 0.76rem;
  }

  .players-metric-copy,
  .players-sex-copy,
  .players-license-copy {
    min-width: 0;
  }

  .players-metric-value,
  .players-sex-value,
  .players-license-number {
    letter-spacing: 0;
  }

  .players-athlete-country,
  .players-athlete-meta-line span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .players-athlete-meta-line span {
    white-space: nowrap;
  }

  .players-athlete-country {
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .players-table tr.players-row {
    gap: 0.6rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-areas:
      "athlete athlete rank"
      "points power power"
      "license sex age";
    padding: 0.82rem 0.62rem 0.68rem;
  }

  .players-athlete-avatar {
    height: 4.2rem;
    width: 4.2rem;
  }

  .players-athlete-avatar-placeholder {
    font-size: 2.3rem;
  }

  .players-athlete-name {
    font-size: 1.7rem;
  }

  .players-rank-badge {
    height: 3.05rem;
    min-height: 3.05rem;
    min-width: 3.05rem;
    width: 3.05rem;
  }

  .players-rank-value {
    font-size: 1.18rem;
  }

  .players-rank-label-mobile {
    font-size: 0.56rem;
  }

  .players-metric-badge {
    grid-template-columns: 1.62rem minmax(0, 1fr);
    padding: 0.62rem 0.52rem;
  }

  .players-metric-badge i {
    height: 1.62rem;
    width: 1.62rem;
  }

  .players-metric-value {
    font-size: 0.95rem;
  }

  .players-metric-label {
    font-size: 0.72rem;
  }

  .players-license-badge,
  .players-sex-badge,
  .players-age-badge {
    gap: 0.28rem;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 2.8rem;
    padding: 0.52rem 0.34rem;
  }

  .players-sex-value,
  .players-license-number,
  .players-age-badge .badge {
    font-size: 0.76rem !important;
  }

  .players-sex-label,
  .players-license-label,
  .players-age-label {
    font-size: 0.58rem;
  }
}
