.page-hero {
  position: relative;
  padding: 110px 0 40px;
  background: linear-gradient(180deg, #2c6cf5 0%, #1a3fb5 60%, transparent 100%);
  text-align: center;
  overflow: hidden;
}

.page-hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -12deg,
    transparent 0 70px,
    rgba(255, 255, 255, 0.04) 70px 140px
  );
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  font-family: "Bungee", sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 0.75rem;
  color: var(--mk-yellow);
  font-style: italic;
  text-transform: uppercase;
  transform: skewX(-6deg);
  text-shadow:
    3px 3px 0 var(--mk-red),
    6px 6px 0 #000;
}

.page-hero .lead {
  max-width: 640px;
  margin: 0 auto;
  margin-bottom: 48px;
  color: var(--ink);
}

#mods.section-block {
  padding: 1rem 0 2rem;
}

#mods .container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 230px);
}

.mods-toolbar {
  flex: 0 0 auto;
  position: sticky;
  top: 68px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(180deg, #f2212b, var(--mk-red) 55%, #b80b14);
  border: 3px solid #000;
  border-radius: 14px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
}

.search-wrap {
  flex: 1 1 320px;
  position: relative;
}

.mod-search {
  width: 100%;
  background: white;
  border: 3px solid black;
  color: #111;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
}

.mod-search::placeholder {
  color: rgba(0, 0, 0, 0.6);
}

.mod-search:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px var(--mk-yellow);
  background: #fff;
  color: #000;
}

.mods-count {
  font-family: "Bungee", sans-serif;
  color: var(--mk-yellow);
  text-shadow: 2px 2px 0 #000;
  font-size: 0.95rem;
  white-space: nowrap;
}

.mod-tag-filter {
  flex: 0 1 210px;
}

.mod-tag-select {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.mod-tag-menu {
  min-width: 100%;
  background: #0f2470;
  border: 3px solid black;
  border-radius: 10px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
  max-height: 240px;
  overflow-y: auto;
}

.mod-tag-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  color: var(--ink);
  font-weight: 600;
}

.mod-tag-option:hover {
  background: rgba(255, 210, 31, 0.15);
}

.mod-tag-option input {
  accent-color: var(--mk-yellow);
}

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-content: start;
  gap: 1.1rem;
  flex: 1 1 auto;
  min-height: 360px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem 1rem 0.5rem;
  scrollbar-color: var(--mk-yellow) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.mod-grid::-webkit-scrollbar {
  width: 10px;
}

.mod-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.mod-grid::-webkit-scrollbar-thumb {
  background: var(--mk-yellow);
  border-radius: 8px;
}

.mod-card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: linear-gradient(180deg, #1a3aa8, #0f2470);
  border: 3px solid var(--mk-yellow);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    0 0 0 2px #000,
    5px 5px 0 2px rgba(0, 0, 0, 0.55);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.mod-card:hover,
.mod-card:focus-visible {
  transform: translate(-2px, -4px);
  border-color: #fff;
  box-shadow:
    0 0 0 2px #000,
    8px 8px 0 2px var(--mk-red);
}

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

.mod-thumb-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--checker);
  background-size: 20px 20px;
  border-bottom: 3px solid black;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mod-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mod-body {
  padding: 0.7rem 0.8rem 0.3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mod-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}

.mod-header h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
  text-shadow: 1px 1px 0 black;
  line-height: 1.25;
}

.mod-version {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: black;
  background: var(--mk-yellow);
  border: 2px solid black;
  border-radius: 6px;
  transform: skewX(-8deg);
  padding: 0.1rem 0.45rem;
}

.mod-author {
  margin: 0.15rem 0 0.4rem;
  font-size: 0.75rem;
  color: var(--mk-yellow);
}

.mod-desc {
  margin: 0;
  color: rgba(232, 240, 235, 0.94);
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mod-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.mod-tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--mk-red);
  border: 2px solid black;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.mod-footer {
  padding: 0.6rem 0.8rem 0.8rem;
}

.mod-footer .btn {
  width: 100%;
  font-size: 0.8rem;
  box-shadow: 3px 3px 0 black;
}

.no-results,
.mods-error {
  text-align: center;
  font-family: "Bungee", sans-serif;
  color: var(--mk-yellow);
  text-shadow: 2px 2px 0 black;
  padding: 2rem 0;
}

.mod-modal-content {
  background: linear-gradient(180deg, #1a3aa8, #0b1a5c);
  border: 4px solid var(--mk-yellow);
  border-radius: 16px;
  color: var(--ink);
  box-shadow:
    0 0 0 4px #000,
    10px 10px 0 4px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.mod-modal-content::before {
  content: "";
  display: block;
  height: 8px;
  background: var(--rainbow);
}

.mod-modal-content .modal-header,
.mod-modal-content .modal-footer {
  border-color: rgba(0, 0, 0, 0.5);
  border-width: 3px;
}

.mod-modal-content .modal-title {
  font-family: "Bungee", sans-serif;
  font-size: 1.2rem;
  color: var(--mk-yellow);
  font-style: italic;
  text-shadow: 2px 2px 0 var(--mk-red), 4px 4px 0 #000;
}

.mod-modal-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mod-modal-img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid #000;
  background: var(--checker);
  background-size: 16px 16px;
  flex-shrink: 0;
}

.mod-modal-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

.mod-modal-tags {
  margin-bottom: 0.75rem;
}

.mod-modal-desc {
  color: rgba(232, 240, 235, 0.94);
  line-height: 1.6;
  white-space: pre-line;
}

@media (max-width: 767px) {
  .mods-toolbar {
    top: 60px;
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap {
    flex: 1 1 auto;
    width: 100%;
  }

  .mods-count {
    text-align: center;
  }

  #mods .container {
    min-height: 0;
  }

  .mod-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: visible;
  }
}
