body.modpacks-page {
  background: #f4f8fb;
}

.modpacks-shell {
  padding-top: 145px;
  padding-bottom: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Hero */
.modpacks-hero {
  margin-bottom: 1.1rem;
}

.modpacks-hero h1 {
  margin: 0 0 0.4rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 2.2rem;
}

.modpacks-hero-lead {
  max-width: 900px;
  margin: 0 0 1rem;
  color: #4b5563;
  font-size: 1rem;
  line-height: 1.55;
}

.modpacks-hero-lead a {
  color: #2563eb;
  font-weight: 600;
}

/* Controls — single compact row that wraps on small screens */
.modpacks-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
}

.modpacks-search-wrap {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}

.modpacks-search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.modpacks-search {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  border: 1px solid #d7e2ee;
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
}

.modpacks-search:focus {
  outline: none;
  border-color: #4aa3df;
  box-shadow: 0 0 0 3px rgba(74, 163, 223, 0.18);
}

.modpacks-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modpacks-loader-btn {
  border: 1px solid #d7e2ee;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.modpacks-loader-btn:hover {
  border-color: #4aa3df;
}

.modpacks-loader-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.modpacks-select-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1rem;
}

.modpacks-select-label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  white-space: nowrap;
}

.modpacks-select {
  padding: 0.5rem 0.7rem;
  border: 1px solid #d7e2ee;
  border-radius: 10px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e293b;
  min-width: 130px;
}

/* Count + grid */
.modpacks-count {
  margin: 1.1rem 0 1rem;
  color: #64748b;
  font-weight: 600;
}

.modpacks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
}

.modpack-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(74, 163, 223, 0.18);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modpack-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modpack-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #0f172a;
  flex: 0 0 64px;
}

.modpack-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 1.4rem;
}

.modpack-head-text {
  min-width: 0;
}

.modpack-title {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  line-height: 1.25;
}

.modpack-author {
  margin: 0.15rem 0 0;
  color: #64748b;
  font-size: 0.85rem;
}

.modpack-desc {
  margin: 0;
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modpack-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
}

.modpack-stat i {
  color: #4aa3df;
  margin-right: 0.25rem;
}

.modpack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.modpack-tag {
  background: #eef2f7;
  color: #475569;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
}

.modpack-tag-loader {
  background: #d9efff;
  color: #0a4b70;
}

.modpack-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.modpack-cta:hover {
  background: #1d4ed8;
  color: #fff;
  transform: translateY(-1px);
}

/* In-feed sponsored affiliate banner */
.modpack-affiliate {
  grid-column: 1 / -1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  background: linear-gradient(120deg, #0f2740 0%, #16395c 60%, #1d4ed8 140%);
  border: 1px solid rgba(74, 163, 223, 0.4);
  border-radius: 18px;
  padding: 1.3rem 1.5rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  color: #f8fafc;
}

.modpack-affiliate-tag {
  position: absolute;
  top: 0.6rem;
  right: 0.85rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.7);
}

.modpack-affiliate-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 420px;
  min-width: 260px;
}

.modpack-affiliate-icon {
  font-size: 1.9rem;
  color: #7dd3fc;
  flex: 0 0 auto;
}

.modpack-affiliate-text h3 {
  margin: 0 0 0.25rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  color: #fff;
}

.modpack-affiliate-text p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(226, 232, 240, 0.9);
}

.modpack-affiliate-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  color: #0f2740;
  font-weight: 800;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
}

.modpack-affiliate-cta:hover {
  background: #fff;
  color: #0f2740;
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .modpack-affiliate-cta {
    width: 100%;
    justify-content: center;
  }
}

/* Load more */
.modpacks-loadmore-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.6rem;
}

.modpacks-loadmore {
  border: 1px solid #2563eb;
  background: #fff;
  color: #2563eb;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.6rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modpacks-loadmore:hover {
  background: #2563eb;
  color: #fff;
}

/* States */
.modpacks-no-results,
.modpacks-empty {
  text-align: center;
  color: #64748b;
}

.modpacks-empty {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 3rem 1.5rem;
  margin: 1rem 0;
}

.modpacks-empty i {
  font-size: 2.5rem;
  color: #cbd5e1;
  margin-bottom: 0.75rem;
}

.modpacks-empty h2 {
  margin: 0 0 0.5rem;
}

.modpacks-no-results {
  margin: 2rem 0;
  font-size: 1.05rem;
}

.modpacks-credit {
  margin: 1.5rem 0 0;
  color: #94a3b8;
  font-size: 0.85rem;
}

.modpacks-credit a,
.modpacks-no-results a {
  color: #2563eb;
}

/* SEO content */
.modpacks-content {
  margin-top: 3rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 2rem;
}

.modpacks-content h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.45rem;
  margin: 1.8rem 0 0.7rem;
}

.modpacks-content h2:first-child {
  margin-top: 0;
}

.modpacks-content p,
.modpacks-steps li {
  color: #374151;
  line-height: 1.65;
}

.modpacks-content a {
  color: #2563eb;
  font-weight: 600;
}

.modpacks-steps {
  padding-left: 1.2rem;
}

.modpacks-steps li {
  margin-bottom: 0.5rem;
}

.modpacks-faq details {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.7rem;
  background: #f8fafc;
}

.modpacks-faq summary {
  font-weight: 700;
  cursor: pointer;
  color: #1e293b;
}

.modpacks-faq p {
  margin: 0.7rem 0 0;
}

.modpacks-internal-links {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid #e2e8f0;
  color: #4b5563;
}

@media (max-width: 640px) {
  .modpacks-shell {
    padding-top: 120px;
  }
  .modpacks-hero h1 {
    font-size: 1.9rem;
  }
  .modpacks-grid {
    grid-template-columns: 1fr;
  }
  .modpacks-content {
    padding: 1.3rem;
  }
}
