/* Pagina */
main.stats-page {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 10px var(--page-pad-x) var(--page-bottom-gap);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.stats-top {
  flex: 0 0 auto;
}

.stats-block {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stats-block--games {
  flex: 1 1 320px;
  min-height: 320px;
}

.stats-block:not(.stats-block--games) {
  flex: 0 0 auto;
  min-height: 110px;
}

.stats-block h2 {
  margin: 6px 0 8px;
  position: relative;
}


/* Filtri */
.statistiche-filtro {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 5px 15px 0 15px;
  border-radius: 15px;
  box-sizing: border-box;
}

.statistiche-filtro select,
.statistiche-filtro #numGiocatori,
.statistiche-filtro #gruppo-select,
.statistiche-filtro #cloud-group-select {
  margin: 5px 2px !important;
  padding: 8px 0;
  height: fit-content;
  border: solid 1px var(--border-color) !important;
  border-radius: 10px;
}

.filter-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.filter-gap {
  width: 10px;
}

#numGiocatori {
  border: solid 1px;
  border-radius: 7px;
}


/* Tabelle */
.table-container-partite,
.table-container-giocatori {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  margin: 0 auto;
  min-height: 100%;
  box-sizing: border-box;
  overflow: auto;
}

.table-container-partite {
  border-radius: 15px;
}

.table-container-giocatori {
  min-height: 73px;
  border-radius: 15px;
}

.elenco-partite,
.statistiche-giocatori {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-radius: 15px;
  scrollbar-width: none;
}

table {
  table-layout: auto;
}

thead th:first-child,
tbody td:first-child,
th.inpunt {
  width: 20%;
  text-align: center;
  font-weight: bold;
}

th,
td {
  padding: 3px;
  text-align: center;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}


/* Azioni */
.statistiche-button-wrapper {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.btn-elimina,
.btn-modifica {
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-elimina i,
.btn-modifica i {
  font-size: 18px !important;
  vertical-align: middle;
  margin-bottom: 3px;
}

#cloud-assign-btn {
  width: auto;
  height: 32px;
  padding: 0 10px;
  margin: 7px 0;
  display: inline-block;
  border: none;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}


/* Popup */
.popup-content {
  width: min(80%, 900px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border-radius: 15px;
  transition:
    max-height 220ms ease,
    transform 220ms ease,
    margin 220ms ease;
  will-change: transform, max-height;
}

.chiudi-popup {
  z-index: 999;
}


/* Keypad */
body.keypad-open .popup {
  padding-top: 16px;
  padding-bottom: calc(var(--keypad-height, 0px) + 16px);
}

body.keypad-open .popup-content {
  max-height: calc(100dvh - var(--keypad-height, 0px) - 32px);
}