
:root {
  /* ---- palette: "pond at dusk" — deep forest green-black surfaces with a
     fresh leaf-green accent and a chartreuse highlight. Every value below is
     copied 1:1 from the LItterbox-main (green) build. --color-preview* has
     no counterpart there since that build has no preview-mod feature — kept
     as its own teal identity so it still reads as a distinct status now
     that the main accent is green too. ---- */
  --color-bg: #0A1710;
  --color-bg-soft: #060F09;
  --color-surface: #132318;
  --color-surface-hover: #1D3324;
  --color-border: #16281B;
  --color-border-strong: #35573D;

  --color-text: #F5F3E9;
  --color-text-muted: #A9C2AC;
  --color-text-faint: #6C8770;

  --color-accent: #6FCB4D;
  --color-accent-dark: #57A93B;
  --color-accent-ink: #0D2007;
  --color-accent-tint: rgba(111, 203, 77, 0.16);

  --color-gold: #D8E85A;
  --color-gold-bg: rgba(216, 232, 90, 0.12);
  --color-gold-border: rgba(216, 232, 90, 0.4);

  /* preview-mod status — chartreuse (same hue as --color-gold), kept a
     shade brighter/flatter so it still reads as its own status pill
     against gold "featured" usage elsewhere in the UI */
  --color-preview: #EAF37E;
  --color-preview-bg: rgba(216, 232, 90, 0.12);
  --color-preview-border: rgba(216, 232, 90, 0.4);
  --color-surface-preview: #1D2413;
  --color-surface-preview-hover: #262F17;

  --color-info: #93AC97;
  --color-info-bg: rgba(147, 172, 151, 0.14);
  --color-info-border: rgba(147, 172, 151, 0.4);

  --color-error: #E2665F;
  --color-error-bg: rgba(226, 102, 95, 0.1);
  --color-error-border: rgba(226, 102, 95, 0.35);

  --color-btn-secondary-bg: #17301F;
  --color-btn-secondary-bg-hover: #1F3E28;

  /* ---- emoji rating scale, angry (1) → grinning (5) ---- */
  --rating-1: #D9615A;
  --rating-2: #D99A4B;
  --rating-3: #93AC97;
  --rating-4: #9ED66B;
  --rating-5: #6FCB4D;

  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --weight-heading: 800;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 1px 2px rgba(0, 0, 0, 0.3);

  --header-h: 64px;

  /* ---- motion: shared easing curves ----
     ease-out: entrances/exits (starts fast, settles gently) — the default for anything appearing/disappearing
     ease-in-out: on-screen moves that don't enter or exit (tab indicators, reordering)
     ease-standard: material-style curve for larger layout-affecting transitions (search bar reflow) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-accent); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: var(--color-accent); color: var(--color-accent-ink); }

h1, h2, h3 { font-weight: var(--weight-heading); letter-spacing: -0.4px; line-height: 1.15; }

/* ---------- section eyebrows ----------
   The recurring "label above a section" pattern (Profile stats, Admin
   queues, live-preview panes, mod detail cards) reads as metadata, so it
   uses the mono face — the same face already used for author bylines,
   timestamps and stat chips — while everything that's prose (names,
   descriptions) stays in the body face. */
.profile-section > h2, .admin-section > h2, .preview-pane h2 {
  font-family: var(--font-mono); font-size: 11.5px; margin: 0 0 14px;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-faint); font-weight: 600;
}
.preview-pane h2 { margin: 0 0 10px; }

/* slim, dark scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: var(--color-border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: var(--radius-pill); border: 2px solid var(--color-bg); }
*::-webkit-scrollbar-thumb:hover { background: #4A7355; }

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-h);
  padding: 0 clamp(16px, 5vw, 40px);
  border-bottom: 1px solid transparent;
  background: rgba(10, 23, 16, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(53, 87, 61, 0.35), 0 12px 24px -12px rgba(0, 0, 0, 0.55);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--color-text); }
.brand-mark { height: 30px; width: 30px; display: block; border-radius: 8px; object-fit: cover; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -0.3px; }

.site-nav, .header-right { display: flex; align-items: center; gap: 6px; position: relative; }

.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--color-text-muted); padding: 8px 14px; border-radius: var(--radius-md);
  background: none; border: none; cursor: pointer; font-family: var(--font-body);
  transition: background .12s ease, color .12s ease;
}
.nav-link:hover { background: var(--color-surface); color: var(--color-text); }
.nav-link.primary { background: var(--color-accent); color: var(--color-accent-ink); font-weight: 700; }
.nav-link.primary:hover { background: var(--color-accent-dark); }

/* ---------- hamburger menu + dropdown drawer (replaces the old row of nav buttons) ---------- */
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: none; border: none; cursor: pointer; color: var(--color-text-muted);
  font-size: 16px; transition: background .12s ease, color .12s ease;
}
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] { background: var(--color-surface); color: var(--color-text); }

.nav-drawer {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 210px; background: rgba(22, 27, 51, 0.86); border: 1px solid var(--color-border-strong);
  border-top-color: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-md); box-shadow: var(--shadow-hover);
  padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 30;
  transform-origin: top right;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: scale(.92) translateY(-6px);
  transition: opacity .16s var(--ease-out), transform .16s var(--ease-out), visibility .16s;
}
.nav-drawer.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: scale(1) translateY(0);
}
.drawer-link {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: var(--font-body);
  color: var(--color-text-muted); text-decoration: none;
  background: none; border: none; cursor: pointer; text-align: left;
  transition: background .1s ease, color .1s ease;
}
.drawer-link:hover { background: var(--color-surface-hover); color: var(--color-text); }
.drawer-link i { width: 16px; text-align: center; flex-shrink: 0; color: var(--color-text-faint); font-size: 13.5px; }
.drawer-link:hover i { color: var(--color-text-muted); }
.drawer-link.primary { color: var(--color-accent); }
.drawer-link.primary i { color: var(--color-accent); }
.drawer-divider { height: 1px; background: var(--color-border); margin: 4px 2px; }

/* ---------- generic surfaces ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 14.5px; letter-spacing: -0.1px;
  border-radius: var(--radius-md); border: none; cursor: pointer;
  padding: 11px 20px; text-decoration: none; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, opacity .12s ease, filter .12s ease, transform .06s ease;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--color-accent); color: var(--color-accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--color-accent-dark); }
.btn-secondary { background: var(--color-btn-secondary-bg); color: var(--color-text); border: 1px solid transparent; }
.btn-secondary:hover:not(:disabled) { background: var(--color-btn-secondary-bg-hover); }
.btn-danger { background: var(--color-error); color: #2a0508; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-block { width: 100%; }

.btn-discord { background: #5865F2; color: #fff; }
.btn-discord:hover:not(:disabled) { background: #4752C4; }

.oauth-divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0;
  color: var(--color-text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
}
.oauth-divider::before, .oauth-divider::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: 0.25; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 6px; color: var(--color-text-muted); }
.field { margin-bottom: 18px; }
.field-hint { font-size: 12px; color: var(--color-text-faint); margin: 6px 0 0; }
.field-hint-inline { font-size: 11.5px; font-weight: 500; color: var(--color-text-faint); text-transform: none; letter-spacing: 0; float: right; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"], textarea {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="url"]:focus, textarea:focus {
  outline: 2px solid var(--color-accent); outline-offset: 1px; border-color: transparent;
}
input::placeholder, textarea::placeholder { color: var(--color-text-faint); }
textarea { resize: vertical; min-height: 90px; }

.file-input {
  display: flex; align-items: center; gap: 10px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--color-bg);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.file-input:hover { border-color: var(--color-accent); background: var(--color-accent-tint); }
.file-input input[type="file"] {
  flex: 1; min-width: 0; font-size: 13px; font-family: var(--font-body); color: var(--color-text-muted);
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .two-col { grid-template-columns: 1fr; } }

.form-msg { font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 18px; display: none; font-weight: 600; }
@keyframes lb-msg-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.form-msg.error, .form-msg.success { display: block; animation: lb-msg-in .22s var(--ease-out); }
.form-msg.error { color: var(--color-error); background: var(--color-error-bg); border: 1px solid var(--color-error-border); }
.form-msg.success { color: var(--color-accent); background: var(--color-accent-tint); border: 1px solid var(--color-accent); }

/* ---------- badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--color-text-muted);
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); padding: 4px 10px;
}
.verified-badge { color: var(--color-accent); font-size: 13px; vertical-align: -1px; margin-left: 3px; flex-shrink: 0; }
.preview-pill { color: var(--color-preview); border-color: var(--color-preview-border); background: var(--color-preview-bg); }
.pending-pill { color: var(--color-info); border-color: var(--color-info-border); background: var(--color-info-bg); }
.rejected-pill { color: var(--color-error); border-color: var(--color-error-border); background: var(--color-error-bg); }

/* small mono tag chip, e.g. the game the mod is for */
.tag-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--color-text-muted); background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  padding: 3px 10px; white-space: nowrap;
}

/* ---------- icon-backed stat chips (downloads / rating / clock etc.) ---------- */
.stat-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--color-text-muted); font-size: 13.5px; font-weight: 500; }
.stat-chip i { flex-shrink: 0; color: var(--color-text-faint); font-size: 12.5px; }
.stat-chip.stat-rating i { color: var(--rating-color, var(--color-gold)); font-size: 14px; }
.stat-chip.stat-rating.no-rating i { color: var(--color-text-faint); }
.stat-chip strong { color: var(--color-text); font-weight: 700; font-family: var(--font-mono); }

/* ---------- empty / loading / error states ---------- */
.empty-state, .error-state, .loading-state {
  font-size: 14px; color: var(--color-text-muted); text-align: center;
  padding: 48px 20px; border-radius: var(--radius-lg);
  animation: lb-msg-in .2s var(--ease-out);
}
.empty-state, .error-state { border: 1px dashed var(--color-border); background: var(--color-surface); }
.error-state { color: var(--color-error); border-color: var(--color-error-border); background: var(--color-error-bg); }
.loading-state { color: var(--color-text-faint); }

.gate-state { max-width: 420px; margin: 96px auto; text-align: center; color: var(--color-text-muted); font-size: 14px; padding: 0 20px; }

/* ---------- shared page-reveal (gate → content) ----------
   Applied to whichever wrapper a page swaps in after its auth/session
   check resolves, so content settles into place instead of popping in.
   JS adds .is-visible one frame after unhiding the wrapper. */
.page-reveal { opacity: 0; transform: translateY(6px); transition: opacity .3s var(--ease-out), transform .3s var(--ease-out); }
.page-reveal.is-visible { opacity: 1; transform: translateY(0); }

footer.site-footer {
  text-align: center; padding: 28px 20px 44px; color: var(--color-text-faint); font-size: 12px;
}
footer.site-footer a { color: var(--color-text-faint); text-decoration: underline; text-underline-offset: 2px; }
footer.site-footer a:hover { color: var(--color-accent); }

/* ---------- notifications ---------- */
.icon-btn { position: relative; padding: 8px 10px; }
.icon-btn i { font-size: 15.5px; }
.notif-dot {
  position: absolute; top: 6px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--color-gold); border: 2px solid var(--color-bg-soft);
}
.notif-panel {
  position: absolute; top: calc(var(--header-h) + 6px); right: clamp(16px, 5vw, 40px);
  width: 320px; max-height: 380px; overflow-y: auto;
  background: rgba(22, 27, 51, 0.86); border: 1px solid var(--color-border-strong);
  border-top-color: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-md); box-shadow: var(--shadow-hover); z-index: 20;
  transform-origin: top right;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: scale(.94) translateY(-6px);
  transition: opacity .16s var(--ease-out), transform .16s var(--ease-out), visibility .16s;
}
.notif-panel.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: scale(1) translateY(0);
}
.notif-item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--color-border); text-decoration: none; color: inherit; transition: background .1s ease; }
.notif-item:last-child { border-bottom: none; }
a.notif-item:hover { background: var(--color-surface-hover); }
.notif-item p { margin: 0 0 3px; font-size: 13.5px; color: var(--color-text); }
.notif-item span { font-size: 11.5px; color: var(--color-text-faint); }
.notif-item.unread { background: var(--color-accent-tint); }
.notif-empty { padding: 20px 14px; font-size: 13px; color: var(--color-text-faint); text-align: center; }

/* capped entrance stagger for the first handful of notifications */
@keyframes lb-item-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
.notif-panel.open .notif-item { animation: lb-item-in .18s var(--ease-out) both; }
.notif-panel.open .notif-item:nth-child(1) { animation-delay: 0ms; }
.notif-panel.open .notif-item:nth-child(2) { animation-delay: 20ms; }
.notif-panel.open .notif-item:nth-child(3) { animation-delay: 40ms; }
.notif-panel.open .notif-item:nth-child(4) { animation-delay: 60ms; }
.notif-panel.open .notif-item:nth-child(5) { animation-delay: 80ms; }
.notif-panel.open .notif-item:nth-child(n+6) { animation-delay: 90ms; }

/* ---------- favorite button ---------- */
.fav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--color-btn-secondary-bg); border: 1px solid transparent;
  color: var(--color-text-muted); border-radius: var(--radius-pill);
  padding: 9px 14px; font-family: var(--font-body); font-weight: 700; font-size: 13.5px; cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.fav-btn:hover { color: var(--color-text); background: var(--color-btn-secondary-bg-hover); }
.fav-btn.active { color: var(--color-accent); border-color: var(--color-accent); background: var(--color-accent-tint); }
.follow-btn.active { color: var(--color-gold); border-color: var(--color-gold); background: var(--color-gold-bg); }
.fav-btn i { font-size: 14px; }
.fav-btn:active { transform: scale(.95); transition: transform .08s var(--ease-out); }
@keyframes lb-fav-pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 70% { transform: scale(.94); } 100% { transform: scale(1); } }
.fav-btn.active i { animation: lb-fav-pop .3s var(--ease-out); }

/* ---------- badges ---------- */
.badge-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-earned {
  background: var(--color-accent-tint); border-color: var(--color-accent); color: var(--color-accent);
  font-weight: 700;
  animation: lb-thumb-in .22s var(--ease-out) both;
}
.badge-earned:nth-child(1) { animation-delay: 0ms; }
.badge-earned:nth-child(2) { animation-delay: 25ms; }
.badge-earned:nth-child(3) { animation-delay: 50ms; }
.badge-earned:nth-child(n+4) { animation-delay: 70ms; }
@keyframes lb-thumb-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.empty-inline { font-size: 13px; color: var(--color-text-faint); margin: 0; }

/* ---- Changelogs / announcements ---- */
.changelog-list { display: flex; flex-direction: column; gap: 12px; }
.changelog-item { padding: 14px 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.changelog-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.changelog-item-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.announcement-pill { color: var(--color-accent); border-color: rgba(111, 203, 77, 0.4); background: var(--color-accent-tint); }
.changelog-title { font-size: 14.5px; font-weight: 700; margin: 0; letter-spacing: -0.2px; color: var(--color-text); }
.changelog-date { font-size: 12px; color: var(--color-text-faint); white-space: nowrap; }
.changelog-body { font-size: 13.5px; }
.changelog-body p:last-child { margin-bottom: 0; }
.changelog-delete-btn {
  margin-top: 8px; background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--color-text-faint);
}
.changelog-delete-btn:hover { color: var(--color-error); }
.changelog-delete-btn:disabled { opacity: .6; cursor: not-allowed; }
.changelog-divider { height: 1px; background: var(--color-border); margin: 22px 0 18px; }
.main-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- markdown editor ---------- */
.md-editor { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); overflow: hidden; }
.md-toolbar {
  display: flex; align-items: center; gap: 2px; padding: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border); background: var(--color-surface);
}
.md-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--radius-sm); color: var(--color-text-muted);
  font-size: 13px; cursor: pointer; font-family: var(--font-body);
}
.md-btn:hover { background: var(--color-surface-hover); color: var(--color-text); }
.md-tabs { margin-left: auto; display: flex; gap: 2px; }
.md-tab {
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: var(--radius-pill);
  background: none; border: none; color: var(--color-text-faint); cursor: pointer; font-family: var(--font-body);
  transition: background .16s ease, color .16s ease;
}
.md-tab.active { background: var(--color-btn-secondary-bg); color: var(--color-text); }
.md-textarea {
  display: block; width: 100%; min-height: 160px; border: none; background: transparent;
  color: var(--color-text); font-family: var(--font-body); font-size: 14px; padding: 12px; resize: vertical;
}
.md-textarea:focus { outline: none; }
.md-preview { padding: 12px 14px; min-height: 160px; font-size: 14px; }

/* rendered markdown content (mod description, preview pane) */
.md-content, .md-preview { color: var(--color-text); line-height: 1.6; }
.md-content p, .md-preview p { margin: 0 0 12px; }
.md-content h1, .md-content h2, .md-content h3,
.md-preview h1, .md-preview h2, .md-preview h3 { margin: 18px 0 8px; letter-spacing: -0.3px; }
.md-content ul, .md-content ol, .md-preview ul, .md-preview ol { margin: 0 0 12px; padding-left: 22px; }
.md-content blockquote, .md-preview blockquote {
  margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--color-accent);
  color: var(--color-text-muted); background: var(--color-surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.md-content code, .md-preview code {
  font-family: var(--font-mono); font-size: 12.5px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: 5px; padding: 1px 5px;
}
.md-content pre, .md-preview pre {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 12px; overflow-x: auto; margin: 0 0 12px;
}
.md-content pre code, .md-preview pre code { border: none; padding: 0; background: none; }
.md-content img, .md-preview img { border-radius: var(--radius-sm); margin: 4px 0 12px; }
.md-content a, .md-preview a { text-decoration: underline; }
.embed-yt { position: relative; padding-top: 56.25%; margin: 4px 0 14px; border-radius: var(--radius-md); overflow: hidden; background: var(--color-bg); }
.embed-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- profile page ---------- */
.profile-head { display: flex; align-items: center; gap: 20px; padding: 32px clamp(16px, 5vw, 56px) 8px; max-width: 1180px; margin: 0 auto; flex-wrap: wrap; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%; background: var(--color-accent-tint);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0;
  font-family: var(--font-mono); font-weight: 700; font-size: 26px; color: var(--color-accent);
  border: 3px solid var(--color-border);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -0.5px; }
.profile-bio { color: var(--color-text-muted); font-size: 14px; max-width: 60ch; margin: 4px 0 0; }
.profile-stats-row { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; }
.profile-section { max-width: 1180px; margin: 0 auto; padding: 20px clamp(16px, 5vw, 56px); }
.profile-edit-form { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }

/* ---------- mod card (browse list, live preview, anywhere) ---------- */
.mod-row {
  position: relative;
  display: flex; gap: 14px; padding: 14px 16px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  transition: border-color .12s ease, background .12s ease, transform .12s ease, box-shadow .12s ease;
  text-decoration: none; color: inherit;
}
.mod-row.is-preview { background: var(--color-surface-preview); }
@media (hover: hover) and (pointer: fine) {
  a.mod-row:hover {
    border-color: var(--color-border-strong); background: var(--color-surface-hover);
  }
  a.mod-row.is-preview:hover { background: var(--color-surface-preview-hover); }
  a.mod-row:hover .mod-name { color: var(--color-accent); }
  a.mod-row.is-preview:hover .mod-name { color: var(--color-preview); }
}
a.mod-row:active { transform: scale(.99); transition-duration: .08s; }

/* capped entrance stagger — replays on every re-render since the list is
   rebuilt via innerHTML, not just on first page load */
@keyframes lb-card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.mods-list .mod-row { animation: lb-card-in .3s var(--ease-out) both; }
.mods-list .mod-row:nth-child(1) { animation-delay: 0ms; }
.mods-list .mod-row:nth-child(2) { animation-delay: 25ms; }
.mods-list .mod-row:nth-child(3) { animation-delay: 50ms; }
.mods-list .mod-row:nth-child(4) { animation-delay: 75ms; }
.mods-list .mod-row:nth-child(5) { animation-delay: 100ms; }
.mods-list .mod-row:nth-child(6) { animation-delay: 125ms; }
.mods-list .mod-row:nth-child(n+7) { animation-delay: 140ms; }

/* ---- banner (cover image the card is built around) ----
   Hidden by default (list view stays compact/icon-led); grid view and the
   narrow preview-pane switch it on below, where there's room for it to
   actually read as a cover photo instead of a stretched icon.
   Mods without an uploaded banner fall back to a flat duotone + dot-grid
   pattern, picked per mod (by id hash, see LB_renderModCard) rather than
   by position - a card keeps the same look as the list re-sorts. Three
   variants, all built from the site's own leaf-green/chartreuse palette
   instead of a generic gradient-mesh wash. Real banner_url images (set
   inline by JS) always win over these. */
.mod-banner-wrap { display: none; position: relative; }
.mod-banner-img {
  width: 100%; height: 100%;
}
.pattern-0 .mod-banner-img { background-color: var(--color-accent-ink); }
.pattern-1 .mod-banner-img { background-color: var(--color-bg-soft); }
.pattern-2 .mod-banner-img { background-color: var(--color-surface); }
.mod-row.is-preview .mod-banner-img { background-color: var(--color-surface-preview); }

.mod-icon {
  width: 96px; height: 96px; border-radius: var(--radius-lg);
  background: var(--color-accent-tint); flex-shrink: 0; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 16px; color: var(--color-accent);
  border: 1px solid var(--color-border); overflow: hidden;
  transition: border-color .12s ease;
}
.mod-icon img { width: 100%; height: 100%; object-fit: cover; }

.mod-body { display: contents; }
.mod-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.mod-title-row { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.mod-name { font-family: var(--font-body); font-weight: 700; font-size: 17.5px; margin: 0; letter-spacing: -0.01em; color: var(--color-text); transition: color .12s ease; }
.mod-author { font-family: var(--font-mono); font-size: 12.5px; color: var(--color-text-faint); }
.author-link { color: inherit; text-decoration: none; cursor: pointer; }
.author-link:hover { color: var(--color-accent); text-decoration: underline; }

.mod-desc {
  color: var(--color-text-muted); font-size: 13.5px; line-height: 1.4; margin: 0;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.mod-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 0; }
.manage-link { font-size: 12px; font-weight: 700; color: var(--color-accent); }

.mod-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; flex-shrink: 0; }
.mod-stats-row { display: flex; align-items: center; gap: 14px; }

/* ---- grid view + preview-pane (both are single-column "cards", so they
   share the exact same banner treatment) ---- */
.mods-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mods-list.grid .mod-row, .preview-pane .mod-row {
  flex-direction: column; align-items: flex-start; padding: 0; overflow: hidden;
}
.mods-list.grid .mod-banner-wrap, .preview-pane .mod-banner-wrap { display: block; width: 100%; height: 112px; }
.mods-list.grid .mod-icon, .preview-pane .mod-icon {
  width: 56px; height: 56px; margin: -28px 0 0 14px;
  border: 3px solid var(--color-surface);
}
@media (hover: hover) and (pointer: fine) {
  a.mod-row:hover .mod-icon { border-color: var(--color-surface-hover); }
  a.mod-row.is-preview:hover .mod-icon { border-color: var(--color-preview-bg); }
}
.mods-list.grid .mod-body, .preview-pane .mod-body { display: block; width: 100%; padding: 8px 14px 14px; }
.mods-list.grid .mod-main, .preview-pane .mod-main { width: 100%; }
.mods-list.grid .mod-desc, .preview-pane .mod-desc { -webkit-line-clamp: 3; margin-top: 6px; }
.mods-list.grid .mod-side, .preview-pane .mod-side { flex-direction: row-reverse; justify-content: space-between; width: 100%; align-items: center; margin-top: 10px; }
.mods-list.grid .mod-stats-row, .preview-pane .mod-stats-row { flex-direction: row-reverse; }

@media (max-width: 480px) {
  .mods-list:not(.grid) .mod-row { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .mods-list:not(.grid) .mod-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); }
  .mods-list.grid .mod-banner-wrap { height: 92px; }
  .mod-name { font-size: 15.5px; }
  .mod-desc { font-size: 13px; }
  .mods-list:not(.grid) .mod-side { width: 100%; align-items: flex-start; flex-direction: row; justify-content: space-between; }
  .mods-list.grid .mod-side { flex-direction: row; }
}

/* ---------- browse tabs (Mods / Creators) ---------- */
.browse-tabs { display: inline-flex; gap: 2px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 3px; }
.browse-tab {
  font-family: var(--font-body); font-size: 13.5px; font-weight: 700; border: none; cursor: pointer;
  padding: 7px 16px; border-radius: var(--radius-pill); background: none; color: var(--color-text-muted);
  transition: background .16s ease, color .16s ease;
}
.browse-tab.active { background: var(--color-accent); color: var(--color-accent-ink); }

/* ---------- creator card (Creators tab) ---------- */
.creator-row {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); text-decoration: none; color: inherit;
  transition: border-color .12s ease, background .12s ease, transform .12s ease, box-shadow .12s ease;
  animation: lb-card-in .3s var(--ease-out) both;
}
@media (hover: hover) and (pointer: fine) {
  .creator-row:hover { border-color: var(--color-border-strong); background: var(--color-surface-hover); }
}
.creator-row:active { transform: scale(.99); transition-duration: .08s; }
.creator-row:nth-child(1) { animation-delay: 0ms; }
.creator-row:nth-child(2) { animation-delay: 25ms; }
.creator-row:nth-child(3) { animation-delay: 50ms; }
.creator-row:nth-child(4) { animation-delay: 75ms; }
.creator-row:nth-child(5) { animation-delay: 100ms; }
.creator-row:nth-child(6) { animation-delay: 125ms; }
.creator-row:nth-child(n+7) { animation-delay: 140ms; }
.creator-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--color-accent-tint); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-family: var(--font-mono); font-weight: 700; font-size: 16px; color: var(--color-accent);
}
.creator-avatar img { width: 100%; height: 100%; object-fit: cover; }
.creator-main { flex: 1; min-width: 0; }
.creator-name { font-weight: 800; font-size: 16px; margin: 0 0 2px; }
.creator-bio { font-size: 13.5px; color: var(--color-text-muted); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator-stats { display: flex; gap: 14px; flex-shrink: 0; }

/* ---------- live card preview (upload / edit) ---------- */
.form-with-preview { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.preview-pane { position: sticky; top: calc(var(--header-h) + 20px); }
.preview-pane .mod-row { cursor: default; }
@media (max-width: 860px) {
  .form-with-preview { grid-template-columns: 1fr; }
  .preview-pane { position: static; }
}

/* ---------- moderation / reports ---------- */
.status-banner {
  margin: 24px 0 0; padding: 14px 16px;
  border: 1px solid var(--color-info-border); background: var(--color-info-bg);
  border-radius: var(--radius-lg); font-size: 13.5px; color: var(--color-text-muted); line-height: 1.5;
  animation: lb-msg-in .25s var(--ease-out);
}
.status-banner strong { color: var(--color-info); }
.status-banner.rejected { border-color: var(--color-error-border); background: var(--color-error-bg); }
.status-banner.rejected strong { color: var(--color-error); }

.report-link { font-size: 12.5px; font-weight: 600; color: var(--color-text-faint); background: none; border: none; cursor: pointer; text-decoration: underline; padding: 0; font-family: var(--font-body); }
.report-link:hover { color: var(--color-text); }
.report-form { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; animation: lb-msg-in .2s var(--ease-out); }
.report-form select { width: 100%; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 9px 10px; color: var(--color-text); font-family: var(--font-body); font-size: 13.5px; }

/* ---------- admin dashboard ---------- */
.admin-section { max-width: 1020px; margin: 0 auto; padding: 20px clamp(16px, 5vw, 56px); }
.admin-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 10px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  transition: opacity .18s var(--ease-out), transform .18s var(--ease-out);
}
.admin-row.row-exit { opacity: 0; transform: scale(.97); pointer-events: none; }
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-title { font-weight: 700; font-size: 14.5px; margin: 0 0 2px; }
.admin-row-meta { font-size: 12.5px; color: var(--color-text-faint); margin: 0; }
.admin-row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.admin-row-actions .btn { padding: 8px 14px; font-size: 13px; }

/* ---------- responsive shell helpers ---------- */
@media (max-width: 480px) {
  .site-header { padding: 0 16px; }
  .brand-name { font-size: 15px; }
  .nav-link { padding: 7px 10px; font-size: 13px; }
}

/* ---------- category picker (upload/edit forms + index filter row) ---------- */
.category-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.category-chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  color: var(--color-text-muted); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  padding: 7px 14px; cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.category-chip-btn i { font-size: 12px; color: var(--color-text-faint); transition: color .12s ease; }
.category-chip-btn:hover { border-color: var(--color-border-strong); color: var(--color-text); }
.category-chip-btn.active { background: var(--color-accent-tint); border-color: var(--color-accent); color: var(--color-accent); }
.category-chip-btn.active i { color: var(--color-accent); }

/* read-only chip row shown on mod cards / mod page */
.category-chip-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.category-pill i { color: var(--color-accent); font-size: 10px; }
.category-pill-more { color: var(--color-text-faint); }

/* ---------- screenshot upload (upload/edit forms) ---------- */
.screenshot-upload-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px;
  margin-top: 10px;
}
.screenshot-upload-item {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--color-accent-tint); border: 1px solid var(--color-border);
  animation: lb-thumb-in .2s var(--ease-out);
}
.screenshot-upload-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.screenshot-upload-item .screenshot-remove-btn {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; border: none; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s ease;
}
.screenshot-upload-item .screenshot-remove-btn:hover { background: rgba(0,0,0,.85); }
.screenshot-upload-item.is-existing::after {
  content: "Saved"; position: absolute; left: 4px; bottom: 4px;
  font-size: 10px; font-weight: 700; color: #fff; background: rgba(0,0,0,.55);
  border-radius: var(--radius-pill); padding: 2px 7px;
}
.screenshot-upload-empty {
  border: 1px dashed var(--color-border-strong); border-radius: var(--radius-sm);
  aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center;
  color: var(--color-text-faint); font-size: 12px; text-align: center; padding: 8px;
}

/* ---------- screenshot gallery + lightbox (mod page) ---------- */
.screenshot-gallery {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: var(--color-border) transparent;
}
.screenshot-gallery::-webkit-scrollbar { height: 7px; }
.screenshot-gallery::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-pill); }
.screenshot-gallery::-webkit-scrollbar-track { background: transparent; }
.screenshot-thumb {
  position: relative; flex: 0 0 auto; scroll-snap-align: start;
  padding: 0; border: none; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--color-accent-tint); cursor: pointer; aspect-ratio: 16 / 9; height: 190px;
  transition: transform .12s ease;
}
.screenshot-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(10, 23, 16, 0); transition: background .12s ease;
}
@media (hover: hover) and (pointer: fine) {
  .screenshot-thumb:hover { transform: scale(1.025); }
  .screenshot-thumb:hover::after { background: rgba(10, 23, 16, .12); }
}
.screenshot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.screenshot-lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(6, 10, 9, .94);
  align-items: center; justify-content: center; padding: 0;
  animation: lb-msg-in .16s var(--ease-out);
}
.screenshot-lightbox[hidden] { display: none; }
.screenshot-lightbox:not([hidden]) { display: flex; }
.screenshot-lightbox-inner { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.screenshot-lightbox img {
  max-width: 100vw; max-height: 100vh; width: auto; height: auto;
  border-radius: 0; border: none; display: block;
  opacity: 1; transition: opacity .12s ease;
}
.screenshot-lightbox img.is-switching { opacity: 0; }
.lightbox-counter {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 12.5px; color: var(--color-text-faint);
  background: rgba(10, 15, 13, .7); border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); padding: 5px 12px; white-space: nowrap;
}
.lightbox-close {
  position: absolute; top: 14px; right: 18px; z-index: 2;
  background: transparent; border: none;
  width: 40px; height: 40px; font-size: 18px;
  color: var(--color-text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background .12s ease, color .12s ease;
}
.lightbox-close:hover { background: rgba(255,255,255,.08); color: var(--color-text); }
.lightbox-nav {
  position: absolute; top: 0; bottom: 0; z-index: 2;
  background: transparent; border: none; width: 15%; min-width: 60px;
  color: rgba(255,255,255,.55); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 22px; transition: background .12s ease, color .12s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { color: var(--color-text); }
.lightbox-nav:hover { background: linear-gradient(90deg, rgba(0,0,0,.25), transparent); }
.lightbox-prev { left: 0; justify-content: flex-start; padding-left: 14px; background: linear-gradient(90deg, rgba(0,0,0,.15), transparent); }
.lightbox-next { right: 0; justify-content: flex-end; padding-right: 14px; background: linear-gradient(270deg, rgba(0,0,0,.15), transparent); }
@media (max-width: 600px) {
  .lightbox-close { width: 34px; height: 34px; top: 10px; right: 10px; }
  .lightbox-nav { min-width: 44px; font-size: 18px; }
  .screenshot-thumb { height: 120px; }
}