/* -----------------------------
 Section Title + Search bar wrap
------------------------------ */
.container > .section-title,
.container > .search-wrap {
  width: min(var(--band-width, 90vw), 100%);
  max-width: var(--band-max, 1400px);
  margin-inline: auto; /* centers the BAND, not the text */
  padding-inline: var(--container-gutter, 0.9rem);
  box-sizing: border-box;
  text-align: left;
}

.container > .section-title {
  margin-top: 0.9rem;
  margin-bottom: 0.9rem;
}
.container > .section-title > h1,
.container > .section-title > h2 {
  margin: 0.9rem 0;
  text-align: left;
}

.container > .search-wrap {
  margin: 0.5rem auto 1rem; 
}

/* -----------------------------
     Search
  ------------------------------ */
.search-wrap {
  display: grid;
  gap: 6px;
  margin: 0.5rem 0 1rem;
}

.search-label {
  font-size: 13px;
  color: var(--muted);
}

#search {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

#search:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* -----------------------------
     Card Grid
  ------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.result-title {
  margin: 1rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--muted);
}

/* -----------------------------
     Game Card
  ------------------------------ */
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.game-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* -----------------------------
     Cover Slot
  ------------------------------ */
.cover-wrap {
  aspect-ratio: 3 / 4;
  background: var(--bg-alt);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

@media (min-width: 1024px) {
  .cover-wrap {
    aspect-ratio: 4 / 5;
  }
}

.game-cover {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

/* -----------------------------
     Card Body
  ------------------------------ */
.card-body {
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.game-name {
  font-weight: 700;
}

.game-sub {
  font-size: 12px;
  color: var(--muted);
}

.game-notes {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -----------------------------
     Whole-card Link
  ------------------------------ */
.card-link {
  position: absolute;
  inset: 0;
  text-indent: -9999px;
}

/* -----------------------------
     Disabled / Coming Soon
  ------------------------------ */
.game-card.is-disabled {
  filter: grayscale(1);
  opacity: 0.65;
}

.game-card.is-disabled .card-link {
  pointer-events: none;
}

.coming-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  padding: 3px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.coming-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

/* -----------------------------
     Fallback / Empty States
  ------------------------------ */
.grid-fallback {
  margin-top: 0.75rem;
}

#secondary-wrap {
  margin-top: 1rem;
}

/* -----------------------------
     Responsive
  ------------------------------ */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .game-notes {
    display: none;
  }
}
