:root {
  --bg: #050a08;
  --card: #0a1411;
  --fg: #f1f7f4;
  --fg-2: rgba(241, 247, 244, 0.7);
  --muted: rgba(241, 247, 244, 0.5);
  --faint: rgba(241, 247, 244, 0.35);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-hover: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --primary: #34d399;
  --primary-hover: #a7f3d0;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 10%, transparent 60%);
  mask-image: radial-gradient(ellipse at 50% 0%, black 10%, transparent 60%);
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: rgba(52, 211, 153, 0.3); }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* ---------------------------------------------------------------- controls */

input {
  height: 40px; padding: 0 14px; min-width: 0;
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px;
  outline: none; transition: border-color .15s, background .15s;
}
input::placeholder { color: var(--faint); }
input:focus { border-color: rgba(52, 211, 153, 0.5); background: var(--glass-hover); }

button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--line-strong); color: var(--fg);
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
button:hover { background: rgba(255, 255, 255, 0.08); }
button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button.primary { background: var(--primary); border-color: var(--primary); color: #000; }
button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.quiet { background: none; border-color: transparent; color: var(--muted); }
button.quiet:hover { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
button.linkish { height: auto; padding: 0; background: none; border: 0; color: inherit; font-size: inherit; font-weight: 400; }
button.linkish:hover { color: var(--fg); }

/* ---------------------------------------------------------------- header */

.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(5, 10, 8, 0.8);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand img { image-rendering: pixelated; border-radius: 6px; }
.badge { font-family: "Inter", sans-serif; font-size: 12px; font-weight: 500; color: var(--fg-2); padding: 3px 10px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); }

.who { display: flex; align-items: center; gap: 10px; }
.who label { color: var(--muted); font-size: 13px; }
.who input { width: 160px; }
.admin-flag { font-size: 12px; font-weight: 500; color: var(--fg-2); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); }

.tabs {
  display: flex; gap: 2px; width: max-content; max-width: 100%;
  margin-bottom: 14px; padding: 4px; overflow-x: auto; scrollbar-width: none;
  background: var(--glass); border: 1px solid var(--line); border-radius: 999px;
}
.tabs button {
  height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: none; color: var(--muted); font-weight: 500;
}
.tabs button:hover { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
.tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.1); color: var(--fg); }
.count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
[aria-selected="true"] .count { color: var(--muted); }

/* ---------------------------------------------------------------- content */

main.wrap { padding-top: 28px; padding-bottom: 48px; }
.search { display: flex; gap: 8px; }
.search input { flex: 1; height: 46px; padding: 0 16px; font-size: 15px; }
.search button { height: 46px; padding: 0 20px; }
.hint { color: var(--muted); font-size: 13px; margin: 14px 2px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.mods { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mod {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 16px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line);
  transition: background .15s, border-color .15s;
}
.mod:hover { background: var(--glass-hover); border-color: var(--line-strong); }

.icon { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--card); border: 1px solid var(--line); }
.icon.placeholder { display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--muted); }
.body { min-width: 0; }
.title { font-family: var(--display); font-weight: 600; font-size: 16px; text-decoration: none; }
.title:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.desc { margin: 2px 0 0; color: var(--fg-2); font-size: 13.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta { margin: 6px 0 0; color: var(--faint); font-size: 12px; }
.actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

#search-results .status-approved,
#search-results .status-rejected { opacity: .45; }
#search-results .status-approved .icon,
#search-results .status-rejected .icon { filter: grayscale(1); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { color: var(--primary); border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.08); }

.empty { color: var(--muted); padding: 40px 24px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 16px; }
.more { display: flex; margin: 20px auto 0; }

.rejected { margin-top: 28px; }
.rejected summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.rejected summary:hover { color: var(--fg); }
.rejected .mod { opacity: .55; }

.login { max-width: 400px; margin: 48px auto; padding: 28px; background: var(--glass); border: 1px solid var(--line); border-radius: 24px; }
.login h2 { margin: 0 0 16px; font-family: var(--display); font-size: 20px; font-weight: 600; }
.login form { display: flex; gap: 8px; }
.login input { flex: 1; height: 40px; }
.login button { height: 40px; }
.error { color: var(--fg-2); font-size: 13px; margin-bottom: 0; }

.foot { display: flex; gap: 20px; justify-content: center; color: var(--faint); font-size: 13px; padding-bottom: 36px; }
.foot a { text-decoration: none; }
.foot a:hover, .foot button:hover { color: var(--fg); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px);
  background: rgba(10, 20, 17, 0.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .who { width: 100%; }
  .who input { flex: 1; }
  .tabs button { padding: 0 11px; font-size: 13.5px; }
  .mod { grid-template-columns: 40px 1fr; gap: 12px; }
  .icon { width: 40px; height: 40px; border-radius: 10px; }
  .actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
