/* ── Reset & base ───────────────────────────────────── */
* { box-sizing: border-box; }

/* ── Cards ─────────────────────────────────────────── */
.game-card {
  display: block;
  text-decoration: none;
  outline: none;
  min-width: 0;
}
.game-card:hover .card-inner {
  transform: translateY(-6px) scale(1.03);
  border-color: rgba(124, 244, 196, 0.3); /* your --accent color */
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.card-inner {
  display: flex;
  flex-direction: column;
  background: #1e2433;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
  width: 100%;
  min-width: 0;
}

/* Square image using aspect-ratio */
.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #12161f;
  flex-shrink: 0;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-genre-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(0,0,0,0.65);
  color: #e2e8f0;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 2;
  white-space: nowrap;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-body {
  padding: 5px 7px 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.card-title {
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  min-width: 0;
}
.card-desc {
  font-size: 10px;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  line-height: 1.4;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
  min-width: 0;
  overflow: hidden;
}
.card-tag {
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 99px;
  background: rgba(255,255,255,0.06);
  color: #64748b;
  border: 1px solid rgba(255,255,255,0.07);
  white-space: nowrap;
}

/* ── Tag filter chips ───────────────────────────────── */
.tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}
.tag-chip:hover { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.tag-chip.active {
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.45);
  color: #a5b4fc;
}

.tag-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.tag-toggle-btn:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }

/* ── Random button ──────────────────────────────────── */
#randomGameBtn {
  height: 34px;
  padding: 0 14px;
  border-radius: 99px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}
#randomGameBtn:hover { background: rgba(255,255,255,0.13); color: #e2e8f0; }

/* ── Section labels ─────────────────────────────────── */
.section-heading {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

#backToTop { font-size: 15px; line-height: 1; }

/* ── Nav pills ──────────────────────────────────────── */
.nav-pill {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.nav-pill:hover { background: rgba(255,255,255,0.7); color: #111827; }
.dark .nav-pill:hover { background: rgba(255,255,255,0.1); color: #f9fafb; }
.nav-pill.active {
  background: white;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.dark .nav-pill.active { background: #374151; color: #f9fafb; }

/* ── Force grids via CSS (not Tailwind) ─────────────── */
#gameGrid, #gamesList {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
@media (min-width: 1280px) {
  #gameGrid, #gamesList { grid-template-columns: repeat(8, 1fr); }
}
@media (min-width: 1536px) {
  #gameGrid, #gamesList { grid-template-columns: repeat(10, 1fr); }
}

#recentRow, #featuredRow, #recommendedRow {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
@media (max-width: 1024px) {
  #recentRow, #featuredRow, #recommendedRow { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 640px) {
  #recentRow, #featuredRow, #recommendedRow,
  #gameGrid, #gamesList { grid-template-columns: repeat(3, 1fr); }
}