th,
td {
  text-align: center;
}

th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f1f1f1;
  background-clip: padding-box;
  white-space: nowrap;
}

#monstersTable tbody tr:hover td,
#monstersTable td.column-hover,
#monstersTable th.column-hover {
  background-color: #e8f6d8;
}

#monstersTable tbody tr:hover td.column-hover {
  background-color: #d9efc2;
}

th button {
  width: 100%;
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

th button::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid #888;
  opacity: 0;
}

th button[data-direction='asc']::after {
  opacity: 1;
}

th button[data-direction='desc']::after {
  opacity: 1;
  border-bottom: 0;
  border-top: 5px solid #888;
}

#monster-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 5px 12px;
  max-width: 900px;
  padding: 6px 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #ccc;
  background: #f7f7f7;
}

#monster-filters label {
  display: grid;
  grid-template-columns: 70px minmax(55px, 1fr) 12px minmax(55px, 1fr);
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

#monster-filters input {
  width: 74px;
  box-sizing: border-box;
}

#monstersTable {
  overflow: visible;
}

#monstersTable table {
  min-width: 900px;
}

#monstersTable .monster-name {
  white-space: nowrap;
}
