/* ─── Loader Enhanced ────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.8s cubic-bezier(0.4,0,0.2,1), visibility 0.8s;
}
#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Particles background */
#page-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(193,18,31,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,45,45,0.08) 0%, transparent 50%);
  animation: loaderBg 4s ease-in-out infinite alternate;
}
@keyframes loaderBg {
  from { opacity: 0.5; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.05); }
}

/* Floating particles */
.loader-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.loader-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent-red);
  border-radius: 50%;
  opacity: 0;
  animation: particleFly var(--dur, 3s) var(--delay, 0s) ease-in-out infinite;
}
@keyframes particleFly {
  0%   { opacity: 0;   transform: translateY(0)    scale(0); }
  20%  { opacity: 0.8; transform: translateY(-30px) scale(1); }
  80%  { opacity: 0.4; transform: translateY(-120px) scale(0.6); }
  100% { opacity: 0;   transform: translateY(-200px) scale(0); }
}

/* Inner content */
.loader-inner {
  text-align: center;
  position: relative;
  z-index: 2;
}

/* Icon ring */
.loader-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  margin-bottom: 28px;
}
.loader-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent-red);
  border-right-color: rgba(255,45,45,0.3);
  animation: loaderSpin 1s linear infinite;
}
.loader-icon-ring2 {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255,45,45,0.2);
  border-bottom-color: var(--accent-red);
  animation: loaderSpin 1.5s linear infinite reverse;
}
@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}
.loader-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-red);
  animation: loaderIconPulse 2s ease-in-out infinite;
}
@keyframes loaderIconPulse {
  0%,100% { transform: scale(1);    filter: drop-shadow(0 0 8px rgba(255,45,45,0.4)); }
  50%      { transform: scale(1.1); filter: drop-shadow(0 0 20px rgba(255,45,45,0.8)); }
}

/* Logo */
.loader-logo {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--white);
  margin-bottom: 6px;
  animation: loaderFadeUp 0.6s ease 0.2s both;
}
.loader-logo span { color: var(--accent-red); }
@keyframes loaderFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.loader-tagline {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 36px;
  animation: loaderFadeUp 0.6s ease 0.4s both;
}

/* Progress bar */
.loader-bar-wrap {
  animation: loaderFadeUp 0.6s ease 0.5s both;
}
.loader-bar {
  width: 240px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto 12px;
  position: relative;
}
.loader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--deep-red), var(--accent-red), #ff6b6b);
  border-radius: 4px;
  animation: loadBar 1.8s cubic-bezier(0.4,0,0.2,1) forwards;
  position: relative;
}
.loader-fill::after {
  content: "";
  position: absolute;
  right: 0;
  top: -2px;
  width: 8px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.8;
}
.loader-pct {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: monospace;
  letter-spacing: 1px;
}


/* ─── Header ─────────────────────────────────────────────── */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  z-index: 1000;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

#main-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--dur) var(--ease);
}

.nav-logo:hover { opacity: 0.85; }

.logo-icon {
  width: 30px;
  height: 30px;
  background: var(--deep-red);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.logo-accent { color: var(--accent-red); }

/* Search */
.nav-search-wrap {
  flex: 1;
  max-width: 400px;
}

.nav-search {
  position: relative;
}

.nav-search input {
  width: 100%;
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 9px 44px 9px 16px;
  font-size: 0.875rem;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  outline: none;
}

.nav-search input:focus {
  border-color: var(--deep-red);
  box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.14);
}

.nav-search input::placeholder { color: var(--muted); }

.search-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 0 14px;
  color: var(--muted);
  transition: color var(--dur) var(--ease);
  display: flex;
  align-items: center;
}

.search-btn:hover { color: var(--accent-red); }

/* Search suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  z-index: 300;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s var(--ease);
}

.search-suggestions.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sug-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--dur) var(--ease);
  border-bottom: 1px solid rgba(46, 46, 46, 0.5);
}

.sug-item:last-child { border-bottom: none; }
.sug-item:hover { background: var(--light); }

.sug-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-red);
  flex-shrink: 0;
}

.sug-title { flex: 1; font-weight: 500; }
.sug-cat {
  font-size: 0.72rem;
  color: var(--accent-red);
  background: rgba(193, 18, 31, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: capitalize;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  padding: 7px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--r);
  transition: color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--white);
  background: var(--mid);
}

/* Dropdown */
.has-dropdown { position: relative; }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  min-width: 380px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s var(--ease);
  z-index: 200;
}

.has-dropdown:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.dropdown-grid a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r);
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}

.dropdown-grid a svg { color: var(--accent-red); }
.dropdown-grid a:hover { background: var(--light); color: var(--white); }

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.btn-telegram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #229ED9;
  border-radius: var(--r);
  color: white;
  cursor: pointer;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.btn-telegram:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 158, 217, 0.4);
}

.btn-login {
  padding: 8px 20px;
  background: var(--deep-red);
  color: white;
  border-radius: var(--r);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}

.btn-login:hover {
  background: var(--accent-red);
  transform: translateY(-1px);
}

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

.nav-mobile-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-mobile-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-mobile-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav */
.mobile-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--black);
  z-index: 900;
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease);
  overflow-y: auto;
}

.mobile-nav.open { transform: translateX(0); }

.mobile-nav-inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-inner input {
  width: 100%;
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  font-size: 1rem;
  outline: none;
  margin-bottom: 16px;
}

.mobile-nav-inner a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.mobile-nav-inner a:hover {
  background: var(--mid);
  color: var(--white);
}

/* ─── Pages ──────────────────────────────────────────────── */
#app-main { padding-top: var(--header-h); }

.page { display: none; }
.page.active { display: block; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  background: var(--deep-red);
  color: white;
  border-radius: var(--r);
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: var(--accent-red);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 45, 45, 0.35);
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

.btn-primary:active::after {
  animation: ripple 0.4s var(--ease) forwards;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

/* ─── Section layout ─────────────────────────────────────── */
.section-wrap { padding: 64px 0; }
.section-dark  { background: var(--dark); }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title svg { color: var(--accent-red); }

.see-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-red);
  transition: color var(--dur) var(--ease);
}

.see-all:hover { color: var(--deep-red); }

/* ─── Mod cards ──────────────────────────────────────────── */
.mods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 18px;
}

.mod-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  opacity: 0;
  animation: fadeInUp 0.45s var(--ease) forwards;
}

.mod-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5),
              0 0 0 1px var(--deep-red);
  border-color: var(--deep-red);
}

.mod-card-img {
  height: 148px;
  overflow: hidden;
  position: relative;
  background: var(--mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mod-card-img-icon {
  color: rgba(255, 255, 255, 0.08);
  transition: transform 0.4s var(--ease), color 0.3s;
}

.mod-card:hover .mod-card-img-icon {
  color: rgba(193, 18, 31, 0.2);
  transform: scale(1.15) rotate(-6deg);
}

.mod-card-img-icon svg {
  width: 72px;
  height: 72px;
}

.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  pointer-events: none;
  transition: transform var(--dur) var(--ease);
}

.mod-card:hover .cover-img { transform: scale(1.06); }

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.badge-featured { background: linear-gradient(135deg, #f59e0b, #f97316); color: #000; }
.badge-new      { background: var(--deep-red);  color: #fff; }
.badge-hot      { background: linear-gradient(135deg, var(--accent-red), var(--deep-red)); color: #fff; }
.badge-updated  { background: var(--success); color: #fff; }

.card-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  z-index: 2;
}

.card-fav-btn:hover { background: var(--deep-red); color: white; }
.card-fav-btn.active { background: var(--deep-red); color: white; }

.mod-card-body { padding: 14px; }

.mod-card-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-red);
  margin-bottom: 5px;
}

.mod-card-title {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mod-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.mod-card-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--warning);
}

.mod-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.version-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  background: rgba(193, 18, 31, 0.12);
  border: 1px solid rgba(193, 18, 31, 0.25);
  border-radius: 4px;
  color: var(--accent-red);
}

.mod-card-dl {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ─── List items ─────────────────────────────────────────── */
.mods-list { display: flex; flex-direction: column; gap: 10px; }

.mod-list-item {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
  opacity: 0;
  animation: fadeInUp 0.45s var(--ease) forwards;
}

.mod-list-item:hover {
  border-color: var(--deep-red);
  transform: translateX(4px);
}

.mod-list-icon {
  width: 76px;
  height: 76px;
  border-radius: var(--r);
  background: var(--mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.1);
  transition: color var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.mod-list-item:hover .mod-list-icon { color: rgba(193, 18, 31, 0.3); }
.mod-list-icon svg { width: 36px; height: 36px; }

.mod-list-body { flex: 1; min-width: 0; }
.mod-list-cat { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-red); margin-bottom: 4px; }
.mod-list-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.mod-list-desc { font-size: 0.81rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mod-list-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ─── Page hero ──────────────────────────────────────────── */
.page-hero {
  padding: 72px 0 52px;
  background: linear-gradient(180deg, var(--dark) 0%, var(--black) 100%);
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -5%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(193, 18, 31, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero.mini { padding: 44px 0 34px; }

.page-hero h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  animation: fadeInUp 0.5s var(--ease) both;
}

.page-hero.mini h1 { font-size: 1.9rem; }

.page-hero p {
  color: var(--muted);
  font-size: 1rem;
  animation: fadeInUp 0.5s var(--ease) 0.08s both;
}

/* ─── Back to top ────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 42px;
  height: 42px;
  background: var(--deep-red);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(193, 18, 31, 0.4);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--accent-red);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 45, 45, 0.45);
}

/* ─── Notifications ──────────────────────────────────────── */
#notification-container {
  position: fixed;
  top: 76px;
  right: 22px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.notif {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: notifSlide 0.3s var(--ease) forwards;
}

.notif.hide {
  animation: notifSlide 0.3s var(--ease) reverse forwards;
}

.notif.success { border-left: 3px solid var(--success); }
.notif.error   { border-left: 3px solid var(--accent-red); }
.notif.info    { border-left: 3px solid var(--info); }

.notif-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif.success .notif-icon { color: var(--success); }
.notif.error   .notif-icon { color: var(--accent-red); }
.notif.info    .notif-icon { color: var(--info); }

.notif-msg { font-size: 0.875rem; flex: 1; line-height: 1.4; }

/* ─── Modals ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  position: relative;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.28s var(--ease);
}

.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--light);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.modal-close:hover { background: var(--deep-red); color: white; }

/* ─── Form elements ──────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 0.9rem;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  outline: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--deep-red);
  box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--dim); }

.form-group textarea {
  min-height: 90px;
  resize: vertical;
}

/* ─── Toggle ─────────────────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

.toggle-wrap input { display: none; }

.toggle {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease);
}

.toggle::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle-wrap input:checked + .toggle { background: var(--deep-red); }
.toggle-wrap input:checked + .toggle::after { transform: translateX(18px); }

/* ─── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: var(--mid);
  border-radius: 50%;
  margin: 0 auto 20px;
  color: var(--border);
}

.empty-state .empty-icon svg { width: 36px; height: 36px; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 6px; color: var(--white); }
.empty-state p  { font-size: 0.875rem; }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 32px 0;
  flex-wrap: wrap;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover,
.page-btn.active {
  background: var(--deep-red);
  border-color: var(--deep-red);
  color: white;
}

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding-top: 56px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand { max-width: 300px; }

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

.footer-social { display: flex; gap: 10px; }

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  background: var(--mid);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--dur) var(--ease);
}

.footer-social a:hover {
  background: var(--deep-red);
  border-color: var(--deep-red);
  color: white;
  transform: translateY(-2px);
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 0.875rem; color: var(--muted); transition: color var(--dur) var(--ease); cursor: pointer; }
.footer-col ul li a:hover { color: var(--accent-red); }

.footer-recent-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: opacity var(--dur) var(--ease);
  align-items: center;
}

.footer-recent-item:hover { opacity: 0.7; }

.footer-recent-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-red);
}

.footer-recent-title { font-size: 0.82rem; font-weight: 600; margin-bottom: 2px; }
.footer-recent-meta  { font-size: 0.72rem; color: var(--muted); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--dim);
}

.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: var(--dim); transition: color var(--dur) var(--ease); }
.footer-bottom-links a:hover { color: var(--accent-red); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1180px) {
  .mods-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

@media (max-width: 1024px) {
  .nav-links           { display: none; }
  .nav-mobile-toggle   { display: flex; }
  .footer-grid         { grid-template-columns: 1fr 1fr; }
  .container           { padding: 0 18px; }
}

@media (max-width: 768px) {
  .nav-search-wrap     { display: none; }
  .mods-grid           { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .footer-grid         { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom       { flex-direction: column; gap: 12px; text-align: center; }
  .modal-box           { padding: 24px; }
  :root { --header-h: 58px; }
  .nav-logo span       { font-size: 1.05rem; }
  .nav-actions         { gap: 8px; }
  .btn-login           { padding: 8px 14px; font-size: 0.82rem; }
}

@media (max-width: 600px) {
  .container           { padding: 0 14px; }
  .mods-grid           { grid-template-columns: 1fr 1fr; gap: 10px; }
  .page-hero h1        { font-size: 1.7rem; }
  .page-hero p         { font-size: 0.92rem; }
  .section-title       { font-size: 1.3rem; }
  .section-header      { flex-direction: column; align-items: flex-start; gap: 10px; }
  .modal-box           { padding: 18px; width: calc(100% - 24px); }
  .modal-tabs          { font-size: 0.85rem; }
  .form-group input, .form-group select, .form-group textarea { font-size: 0.92rem; }
}

@media (max-width: 480px) {
  .container           { padding: 0 12px; }
  .mods-grid           { grid-template-columns: 1fr 1fr; gap: 8px; }
  .page-hero h1        { font-size: 1.45rem; }
  .section-title       { font-size: 1.18rem; }
  .nav-logo span       { font-size: 0.95rem; }
  .nav-actions .btn-login span { display: none; }
  .footer-bottom-links { flex-direction: column; gap: 10px; }
  .mod-card-title      { font-size: 0.86rem; }
  .mod-card-meta       { font-size: 0.72rem; }
}

@media (max-width: 360px) {
  .mods-grid           { grid-template-columns: 1fr; }
  .page-hero h1        { font-size: 1.3rem; }
}
/* ── Share / Copy Link ─── */
.mod-action-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.btn-copy-link, .btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
}
.btn-copy-link:hover { border-color: var(--accent-red); color: var(--accent-red); }
.btn-share { border-color: #229ED9; color: #229ED9; }
.btn-share:hover { background: rgba(34,158,217,0.1); }

/* ── Notification toast ── */
.ap-notif {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.ap-notif.show { transform: translateY(0); opacity: 1; }
.ap-notif.error { border-color: #ef4444; color: #ef4444; }
.ap-notif.info  { border-color: #3b82f6; color: #3b82f6; }

/* ── Author page ── */
#page-author .page-hero.mini { padding: 0; }