/* ============================================================
   BrainFusion V2 Games By Category
   ============================================================
   "Curated Gallery" -- browsing a well-organized library.
   Horizontal pill bar for instant category awareness,
   grouped sections with rich game cards.
   ============================================================ */

/* ---- Scroll-Triggered Reveals ---- */
.v2-cat-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.v2-cat-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Category Pill Bar ---- */
.v2-cat-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.v2-cat-bar::-webkit-scrollbar {
  display: none;
}

.v2-cat-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 0.5rem 1.125rem;
  border-radius: 9999px;
  border: 1px solid var(--v2-border-default);
  background: transparent;
  color: var(--v2-text-secondary);
  font-family: var(--v2-font-body);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
  flex-shrink: 0;
}

.v2-cat-pill:hover {
  border-color: var(--v2-brand-primary);
  color: var(--v2-brand-primary);
}

.v2-cat-pill.is-active {
  border-color: var(--v2-brand-primary);
  color: var(--v2-brand-primary);
  background: color-mix(in srgb, var(--v2-brand-primary) 10%, var(--v2-surface-card));
  font-weight: 600;
}

.v2-cat-pill:focus-visible {
  outline: 2px solid var(--v2-brand-primary);
  outline-offset: 2px;
}

/* ---- Category Section ---- */
.v2-cat-heading {
  font-family: var(--v2-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--v2-text-primary);
  margin-bottom: 0.25rem;
}

.v2-cat-count {
  font-size: 0.8rem;
  color: var(--v2-text-muted);
  margin-bottom: 1.25rem;
}

/* ---- Game Grid ---- */
.v2-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 480px) {
  .v2-game-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Browse Card (no hover lift, subtle border transition) ---- */
.v2-browse-card {
  border-radius: 0.875rem;
  border: 1px solid var(--v2-border-default);
  background: var(--v2-surface-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.v2-browse-card:hover {
  border-color: var(--v2-brand-primary);
}

.v2-browse-card-title {
  font-family: var(--v2-font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--v2-text-primary);
  margin-bottom: 0.5rem;
}

.v2-browse-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  font-size: 0.8rem;
  color: var(--v2-text-muted);
  margin-bottom: 1rem;
}

.v2-browse-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.v2-browse-card-meta i {
  font-size: 0.7rem;
  color: var(--v2-brand-primary);
}

.v2-browse-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

/* Small button sizing */
.v2-browse-card-actions wa-button {
  --wa-input-height-small: 2rem;
  font-size: 0.8rem;
}

/* ---- Copy Toast ---- */
.v2-copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: var(--v2-brand-primary);
  color: var(--v2-text-inverse);
  font-family: var(--v2-font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.625rem;
  box-shadow: var(--v2-shadow-neutral-md);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100;
}

.v2-copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- CTA Section ---- */
.v2-cat-cta {
  background: linear-gradient(135deg, var(--v2-cta-gradient-start) 0%, var(--v2-cta-gradient-end) 100%);
  color: var(--v2-cta-section-text);
  position: relative;
  overflow: hidden;
}

.v2-cat-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--v2-cta-orb) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}

/* ---- Empty State ---- */
.v2-cat-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--v2-text-muted);
  font-size: 0.95rem;
}

.v2-cat-empty i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
  color: var(--v2-border-strong);
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  .v2-cat-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .v2-copy-toast {
    transition: none;
  }
}
