.page-list-packs {
  display: grid;
  grid-template-columns:
    minmax(180px, 2fr)
    minmax(220px, 2fr)
    minmax(0, 8fr);

  column-gap: 2rem;
  margin: 0 auto;
  height: 100%;
  padding-block: 2rem;

  font-family: "Lexend Deca", system-ui, sans-serif;
}

.page-list-packs * {
  font-family: inherit;
}

.page-list-packs > div {
  overflow-y: auto;
}

.page-list-packs .pack-selector {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.page-list-packs .pack-selector button {
  padding: 0.75rem 1.25rem;
  background-color: var(--color-background);
  color: var(--color-on-background);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.page-list-packs .pack-selector button:hover {
  background-color: var(--color-background-hover);
  color: var(--color-on-background-hover);
}

.page-list-packs .pack-selector button.active {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.page-list-packs .list-container {
  padding-inline: 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 4rem);
}

.page-list-packs .list {
  width: 100%;
  table-layout: auto;
}

.page-list-packs .list .rank {
  text-align: end;
  padding-right: 1rem;
  opacity: 0.7;
}

.page-list-packs .list .level {
  width: 100%;
}

.page-list-packs .list .level button {
  width: 100%;
  text-align: start;
  background-color: var(--color-background);
  color: var(--color-on-background);
  border: none;
  padding: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-list-packs .list .level button:hover {
  background-color: var(--color-background-hover);
}

.page-list-packs .list .level.active button {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.page-list-packs .level-container {
  padding-right: 2rem;
  max-width: 48rem;
}

.page-list-packs .level {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.page-list-packs h1 {
  font-weight: 600;
}

.page-list-packs .level-authors {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 1rem;
}

.page-list-packs .video {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
  display: block;
}

.page-list-packs .stats {
  display: flex;
  justify-content: space-evenly;
  text-align: center;
  gap: 2rem;
}

.page-list-packs .stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.page-list-packs .stats p {
  font-weight: 500;
}

.page-list-packs .pack-completions {
  margin-top: 1rem;
  font-weight: 200;
}

.page-list-packs .pack-completions h2 {
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.page-list-packs .pack-completions .list {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.page-list-packs .pack-completions tr td:not(:last-child) {
  padding-right: 1rem;
}

.page-list-packs .pack-completions td {
  padding-block: 0.75rem;
  vertical-align: middle;
}

.page-list-packs .pack-completions .name {
  width: 100%;
  font-weight: 500;
}

.page-list-packs .pack-completions .completions {
  text-align: end;
  opacity: 0.8;
}

.page-list-packs .pack-completions tr:hover {
  background-color: var(--color-background-hover);
}

.page-list-packs .progress-bar {
  width: 220px;
  height: 10px;
  background: var(--color-background-hover);
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
  margin-right: 0.75rem;
}

.page-list-packs .progress {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.25s ease;
}

.page-list-packs .progress-text {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 1.2rem;
  gap: 0.25rem;
}

@media (max-width: 900px) {
  .page-list-packs {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .page-list-packs .pack-selector {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .page-list-packs .level-container {
    max-width: 100%;
    padding-right: 0;
  }

  .page-list-packs .stats {
    flex-wrap: wrap;
  }

  .page-list-packs .progress-bar {
    width: 120px;
  }
}
