.games-list {
  margin: 1.8rem 0;
}

.games-list-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.games-list-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.games-list-sort select {
  height: 2.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-color);
  font: inherit;
}

.games-list-status-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.games-list-legend-entry {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.5rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-color);
  font: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.games-list-legend-entry[aria-pressed="false"] {
  opacity: 0.5;
}

.games-list-legend-entry:hover {
  background: var(--bg-subtle);
}

.games-list-legend-entry:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

.games-list-legend-color {
  width: 0.9rem;
  height: 0.9rem;
  border: 3px solid;
  border-radius: 3px;
}

.games-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

#games-list-details {
  width: min(38rem, calc(100% - 2rem));
  max-width: none;
  max-height: min(80vh, 42rem);
  overflow-y: auto;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-color);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 30%);
}

#games-list-details::backdrop {
  background: rgb(0 0 0 / 65%);
  backdrop-filter: blur(3px);
}

#games-list-details h2 {
  margin: 0 3.5rem 0.5rem 0;
}

#games-list-details .game-close {
  float: right;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-strong);
  font: inherit;
  cursor: pointer;
}

#games-list-details .game-close:hover {
  background: var(--bg-page);
}

#games-list-details .game-status {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-subtle);
  font-size: 12px;
}

.games-list-item {
  margin: 0;
}

.games-list-item[hidden] {
  display: none;
}

.games-list-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.41;
  padding: 0;
  border: 2px solid;
  border-top: 18px solid;
  border-radius: 6px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.games-list-cover::before {
  position: absolute;
  top: -16px;
  right: 0;
  left: 5px;
  color: #fff;
  font-size: 11px;
  line-height: 13px;
  text-align: start;
  text-transform: lowercase;
  font-style: italic;
  opacity: 0.6;
}

.games-list-cover.is-owned::before {
  content: "Owned";
}

.games-list-cover.is-wishlist::before {
  content: "Wish list";
}

.games-list-cover-year {
  position: absolute;
  top: -16px;
  right: 5px;
  color: #fff;
  font-size: 11px;
  line-height: 13px;
  opacity: 0.6;
}

.is-owned {
  border-color: #27834a;
}

.is-wishlist {
  border-color: #d97706;
}

.games-list-cover img {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  object-fit:fill;
  border-radius: 0 0 4px 4px;
}

.games-list-cover:hover {
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .games-list-legend-entry,
  .games-list-cover {
    transition: none;
  }
}
