/* Games List Specific Styles */
.games-library {
  display: flex;
  flex-direction: column;
  gap: var(--ds-v-stack, 1.25rem);
  width: 100%;
}

.library-header {
  margin-bottom: 0.5rem;
}

/* Category description */
.category-description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 52rem;
}

/* Spotlight Card */
.library-spotlight {
  width: 100%;
  margin-bottom: 1rem;
}

.spotlight-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 14px);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.spotlight-card:hover {
  border-color: var(--border-2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.spotlight-image {
  display: block;
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #1e3a2f, #2fa172);
  flex-shrink: 0;
  text-decoration: none;
}

.spotlight-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.spotlight-image--photo img {
  opacity: 1;
  mix-blend-mode: normal;
}

.spotlight-image:not(.spotlight-image--photo) img {
  opacity: 0.8;
  mix-blend-mode: overlay;
}

.spotlight-content {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.spotlight-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.spotlight-rank-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9a230;
}

.spotlight-title-link {
  text-decoration: none;
  color: inherit;
}

.spotlight-title {
  margin: 0;
  line-height: 1.2;
}

.spotlight-title-link:hover .spotlight-title {
  color: var(--primary);
}

.spotlight-meta {
  margin: 0;
  font-size: 0.8rem;
}

.spotlight-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.spotlight-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-2, rgba(255,255,255,0.07));
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.spotlight-pill .ds-mso {
  font-size: 0.85rem;
  opacity: 0.7;
}

.spotlight-actions {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-shrink: 0;
}

.spotlight-ratings {
  display: flex;
  gap: 0.5rem;
}

.spotlight-rating-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-2, rgba(255,255,255,0.07));
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  padding: 0.5rem 0.85rem;
  min-width: 68px;
}

.spotlight-rating-val {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
}

.spotlight-rating-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.1rem;
}

.spotlight-rating-source {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.spotlight-btn-verdict,
.spotlight-btn-buy {
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
}

@media (min-width: 640px) {
  .spotlight-card {
    flex-direction: row;
    align-items: stretch;
  }
  .spotlight-image {
    width: 200px;
    height: auto;
    min-height: 200px;
  }
  .spotlight-content {
    justify-content: center;
    padding: 1.25rem 1.4rem;
  }
  .spotlight-actions {
    justify-content: center;
    padding: 1.25rem 1.4rem;
    border-left: 1px solid var(--border);
    min-width: 180px;
  }
}

/* Search */
.library-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.library-search__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  transition: border-color 0.15s;
}

.library-search__field:focus-within {
  border-color: var(--primary-border);
}

.library-search__field .ds-mso {
  color: var(--text-muted);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.library-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.library-search__input::placeholder {
  color: var(--text-muted);
}

/* hide native ✕ in webkit search input */
.library-search__input::-webkit-search-cancel-button { display: none; }

.library-search__clear {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-md);
  transition: color 0.15s;
  flex-shrink: 0;
}

.library-search__clear:hover {
  color: var(--text);
}

.library-search__empty {
  padding: 2rem 0;
  text-align: center;
}

/* Filters */
.library-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-pills, .filter-subpills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}

.filter-pills::-webkit-scrollbar, .filter-subpills::-webkit-scrollbar {
  display: none;
}

.filter-row-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.filter-row-heading a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.filter-row-heading a:hover {
  text-decoration: underline;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill, 999px);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill:hover {
  background: var(--surface-2);
  color: var(--text);
}

.filter-pill.active {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-2);
}

.filter-pill .ds-mso {
  font-size: 1.1rem;
}

.library-back-link {
  display: inline-flex;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.library-back-link:hover {
  color: var(--text);
}

.filter-subpills {
  margin-top: 0.25rem;
}

.subpill {
  padding: 0.35rem 0.85rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill, 999px);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.subpill:hover {
  color: var(--text-muted);
  border-color: var(--border-2);
}

.subpill.active {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

/* Category Sections */
.library-sections {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.library-end-link {
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}

.game-category {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.category-see-all {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.category-see-all:hover {
  text-decoration: underline;
}

.taxonomy-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.taxonomy-index__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}

.taxonomy-index__item:hover {
  border-color: var(--border-2);
  background: var(--surface-2);
}

.taxonomy-index__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.taxonomy-index__count {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.game-grid-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.game-grid-scroll::-webkit-scrollbar {
  display: none;
}

.game-grid {
  display: flex;
  gap: 1rem;
  padding-right: 1.25rem; /* padding for scroll end */
}

.game-grid--all {
  flex-wrap: wrap;
  padding-right: 0;
}

/* Game Card */
.game-card {
  display: flex;
  flex-direction: column;
  width: 98px;
  min-width: 98px;
  text-decoration: none;
  color: inherit;
}

.game-card__cover {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-xl, 14px);
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(0,0,0,0.6) 100%), var(--surface-3);
  position: relative;
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.game-card:hover .game-card__cover {
  border-color: var(--primary-border);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.game-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.game-card__cover--photo .game-card__title {
  display: none;
}

.game-card__title {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  margin: 0;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.game-card__info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.game-card__name {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card__meta {
  font-size: 0.75rem;
}

.game-card__stats {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.badge-bg, .badge-peso {
  display: inline-block;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 0.1rem;
}

.badge-bg {
  background: var(--success-soft, rgba(74,222,128,0.10));
  border: 1px solid var(--success-border, rgba(74,222,128,0.25));
  color: var(--success);
}

.badge-peso {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .game-card {
    width: 112px;
    min-width: 112px;
  }
}

/* Empty states for visualization */
.game-card--empty .game-card__cover {
  background: var(--surface-2);
  opacity: 0.5;
}
.empty-line {
  height: 0.85rem;
  background: var(--surface-2);
  border-radius: 4px;
  margin-bottom: 0.25rem;
}
.empty-line.short {
  width: 60%;
}

/* Infinite scroll sentinel */
.infinite-scroll-sentinel {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.infinite-scroll-sentinel.is-loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-2, rgba(255,255,255,0.15));
  border-top-color: var(--text-muted, #888);
  border-radius: 50%;
  animation: bgbot-spin 0.6s linear infinite;
}

@keyframes bgbot-spin {
  to { transform: rotate(360deg); }
}

/* ---- Game Table (filtered category/mechanic pages) ---- */

.game-table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl, 14px);
}

.game-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.game-table thead th {
  padding: 0.6rem 0.875rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.game-table thead th.gt-col-ludo,
.game-table thead th.gt-col-bgg {
  text-align: right;
}

.game-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.game-table tbody tr:last-child {
  border-bottom: none;
}

.game-table tbody tr:hover {
  background: var(--surface-2);
}

.game-table td {
  padding: 0.625rem 0.875rem;
  vertical-align: middle;
}

/* Thumbnail + name cell */
.game-table__thumb-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: inherit;
}

.game-table__thumb {
  width: 83px;
  min-width: 83px;
  height: 83px;
  border-radius: var(--radius-lg, 12px);
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(0,0,0,0.5) 100%), var(--surface-3);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.game-table__row:hover .game-table__thumb {
  border-color: var(--primary-border);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.game-table__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.game-table__thumb-title {
  position: absolute;
  bottom: 0.5rem;
  left: 0.4rem;
  right: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.game-table__name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-table__sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.game-table__weight {
  font-size: 0.73rem;
  color: var(--text-dim);
}

.gt-mobile-ratings {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.73rem;
  font-weight: 700;
}

.gt-mobile-ludo {
  color: var(--success);
}

.gt-mobile-bgg {
  color: var(--text-muted);
}

/* Data columns */
.gt-col-year,
.gt-col-players,
.gt-col-time {
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.gt-col-tags {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 150px;
}

.gt-tag-link {
  color: var(--text-muted);
  text-decoration: none;
}

.gt-tag-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.gt-col-ludo,
.gt-col-bgg {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}

.gt-rating-ludo {
  color: var(--success);
  font-size: 0.95rem;
}

.gt-rating-bgg {
  color: var(--text);
  font-size: 0.95rem;
}

.gt-rating-none {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Light mode overrides */
.theme-light .game-table__row:hover .game-table__thumb {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

/* ---- Pagination nav ---- */

.game-pagination {
  margin-top: 1.25rem;
}

.game-pagination__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.game-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.6rem;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}

.game-pagination__btn:hover {
  border-color: var(--primary-border);
  color: var(--text);
  background: var(--surface-2);
}

.game-pagination__btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  pointer-events: none;
}

.game-pagination__ellipsis {
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0 0.25rem;
}

/* Mobile: hide less critical columns, shrink thumb */
@media (max-width: 479px) {
  .game-table thead th.gt-col-time,
  .game-table thead th.gt-col-tags,
  .game-table thead th.gt-col-players,
  .game-table thead th.gt-col-ludo,
  .game-table thead th.gt-col-bgg,
  .game-table td.gt-col-time,
  .game-table td.gt-col-tags,
  .game-table td.gt-col-players,
  .game-table td.gt-col-ludo,
  .game-table td.gt-col-bgg {
    display: none;
  }

  .game-table__thumb {
    width: 64px;
    min-width: 64px;
    height: 64px;
  }

  .game-table__name {
    max-width: 200px;
    font-size: 0.95rem;
    white-space: normal;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .game-table__weight {
    font-size: 0.7rem;
  }

  .gt-mobile-ratings {
    display: flex;
  }

  .game-table td {
    padding: 0.5rem 0.6rem;
  }

  .game-table thead th {
    padding: 0.5rem 0.6rem;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .game-table thead th.gt-col-tags,
  .game-table td.gt-col-tags {
    display: none;
  }

  .game-table__name {
    max-width: 170px;
  }
}

