/* === Player table styling === */
#stats-player-data-table_wrapper table.dataTable > thead > tr > td:first-child {
  text-align: left;
}


/* === ELO Table Styling === */
#stats-elo-data-table_wrapper table.dataTable {
  border-spacing: 0 4px;

  font-size: 1em;
}

#stats-elo-data-table_wrapper table.dataTable > tbody > tr > td {
  height: 48px;
  font-weight: bold;
  font-size: 1.2em;
  color: var(--text);
}
#stats-elo-data-table_wrapper table.dataTable > thead > tr > td:first-child,
#stats-elo-data-table_wrapper table.dataTable > tbody > tr > td:first-child {
  border-right: none !important;

  min-width: 80px !important;
  max-width: 120px !important;
  width: 120px !important;
}

#stats-elo-data-table_wrapper table.dataTable > tbody > tr > td {
  border-top: none !important;
}


/* Rank styling */
.rank-badge {
  display: grid;
  grid-template-columns: 2fr 3fr;
  align-items: center;
  justify-content: center;

  white-space: nowrap;

  height: 100%;

  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  box-shadow: 0 .125rem .5625rem -0.125rem rgba(0,0,0,.6);
}
.rank-number {
  text-align: right;
}
.rank-change-indicator {
  font-size: 0.8em;
  font-weight: normal;
  text-align: center;
}

/* Rank tooltip styling */
.tippy-box {
  background-color: var(--background);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 .125rem .5625rem -0.125rem rgba(0,0,0,.6);

  font-size: 0.9rem;
}

.tippy-box .history-table {
  border-collapse: collapse;
  width: 100%;
}
.tippy-box .history-table thead th {
  text-align: center;
}  
.tippy-box .history-table tbody td {
  padding: 4px 8px;
  text-align: center;
}
.tippy-box .history-table tbody td:not(:last-child) {
  border-right: 1px solid var(--border);
}


/* Player cell styling */
.player-cell {
  display: flex;
  align-items: center;
  flex-direction: row;
  height: 100%;

  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.table-avatar {
  width: auto;
  height: 100%;
  border-radius: var(--border-radius-sm);
  aspect-ratio: 1/1;
  object-fit: cover;
  box-shadow: 0 .125rem .5625rem -0.125rem rgba(0,0,0,.6);
}
.table-flag {
  width: 24px;
  height: 16px;
}

/* Elo cell styling */
.elo-cell {
  display: grid;
  align-items: center;
  justify-content: center;
  grid-template-columns: 5fr 3fr;
  height: 100%;

  gap: 5px;
}
.elo-value {
  text-align: right;
}
.elo-change-value {
  font-size: 0.8rem;
  font-weight: normal;
  text-align: left;
}

@media screen and (max-width: 768px) {
  /* Player stats styling */
  #stats-player-data-table_wrapper table.dataTable {
    font-size: .875em;
  }
  
  #stats-player-data-table_wrapper table.dataTable > thead > tr > td:first-child,
  #stats-player-data-table_wrapper table.dataTable > tbody > tr > td:first-child {
    min-width: 80px !important;
    max-width: 130px !important;
    width: 130px !important;
  }

  /* Elo leaderboard styling */
  #stats-elo-data-table_wrapper table.dataTable {
    font-size: .875em;
  }

  #stats-elo-data-table_wrapper table.dataTable > thead > tr > td:first-child,
  #stats-elo-data-table_wrapper table.dataTable > tbody > tr > td:first-child {
    min-width: 60px !important;
  }
  .rank-badge {
    display: flex;
    text-align: center;
    grid-template-columns: none;
  }
  .rank-change-indicator,
  .elo-change-value {
    display: none;
  }

  /* General styling */
  div[id$="_wrapper"] .row:first-child {
    flex-direction: column;
    white-space: nowrap;
  }

  div[id$="_wrapper"] .row:first-child > .dt-layout-start,
  div[id$="_wrapper"] .row:first-child > .dt-layout-end {
    justify-content: center !important;
  }


}
