/* Spin page: category shelves, Spotify-style.
   Each category is a row. Cards are square with the name and a short line under them,
   and the row scrolls sideways. Loaded on spin.html only. */

.shelves-title {
  margin: 4px 0 6px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; text-wrap: balance;
}

.shelf-block { display: grid; gap: 12px; margin: 22px 0 0; min-width: 0; }

.shelf-head {
  margin: 0; font-size: 1.2rem; font-weight: 800; display: flex; align-items: baseline; gap: 8px; min-width: 0;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.shelf-count { font-size: .8rem; font-weight: 700; color: var(--muted, #98a6bd); }

/* Shop cards stack one per line, each a long banner: wide cover on top, name and line under it */
.shelf {
  display: grid; gap: 16px; min-width: 0;
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}

.shelf-card {
  flex: 0 0 148px; width: 148px; display: grid; gap: 4px; text-decoration: none; color: var(--ink, #f2f4f8);
  scroll-snap-align: start; min-width: 0;
}
@media (min-width: 560px) { .shelf-card { flex-basis: 168px; width: 168px; } }

.shelf-art {
  display: grid; place-items: center; aspect-ratio: 1 / 1; width: 100%; border-radius: 10px; overflow: hidden;
  background: var(--d-bg, #1b2a44); box-shadow: 0 8px 18px rgba(70, 50, 20, .28);
  transition: transform .15s ease;
}
.shelf-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf-art svg { width: 72%; height: 72%; display: block; }
.shelf-card:hover .shelf-art,
.shelf-card:focus-visible .shelf-art { transform: translateY(-2px); }

.shelf-name {
  margin-top: 8px; font-size: .98rem; font-weight: 700; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shelf-sub {
  font-size: .85rem; color: var(--muted, #98a6bd);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Long vertical banners: full width, one per line */
.shelf .shelf-card { flex: none; width: 100%; }
.shelf .shelf-art { aspect-ratio: 16 / 7; border-radius: 16px; }
.shelf .shelf-name { margin-top: 10px; font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  .shelf-art { transition: none; }
}

/* Lucky Draw page: the draw results are one sideways row of the same cards as the Spin shelves */
.browse-results.draw-shelf {
  display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 32px;
  /* bleeds to the screen edges; the first card lines up with the page heading */
  margin-inline: -32px; padding-inline: 32px; padding-bottom: 6px; scrollbar-width: none; margin-top: 16px;
}
.draw-card .shelf-sub {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.browse-results.draw-shelf::-webkit-scrollbar { display: none; }
.browse-results.draw-shelf > :not(.shelf-card) { flex: 0 0 100%; }
.draw-shelf .shelf-art img { object-fit: cover; }
