:root {
  color-scheme: dark;
  --bg: #09090d;
  --surface: #111116;
  --surface-raised: #17171e;
  --surface-hover: #1c1b24;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #f5f4f8;
  --muted: #9c9aa8;
  --subtle: #686775;
  --purple: #a78bfa;
  --purple-strong: #8b5cf6;
  --green: #6ee7b7;
  --red: #fb7185;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

html {
  overflow-x: clip;
  overscroll-behavior-x: none;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(ellipse at 50% -23%, rgba(119, 72, 209, 0.14), transparent 49%),
    var(--bg);
  color: var(--text);
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.1;
  pointer-events: none;
}
.ambient-one { top: 380px; left: -260px; background: #6635d6; }
.ambient-two { top: 670px; right: -280px; background: #3330ab; }

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 13, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.7px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(198, 175, 255, 0.27);
  border-radius: 10px;
  background: linear-gradient(145deg, #a78bfa, #7045d8);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.24);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}
.brand-light { color: #b6a0fa; }
.desktop-nav, .topbar-actions { display: flex; align-items: center; gap: 8px; }
.desktop-nav { margin-left: 60px; }
.nav-link, .footer-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease, background 160ms ease;
}
.nav-link { padding: 10px 13px; border-radius: 9px; }
.nav-link:hover, .footer-link:hover { color: var(--text); }
.nav-link.active { background: rgba(255, 255, 255, 0.055); color: var(--text); }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.65; transform: none; }
.button-primary {
  border-color: rgba(196, 181, 253, 0.24);
  background: linear-gradient(135deg, #9a72f2, #7548dc);
  box-shadow: 0 5px 16px rgba(105, 63, 209, 0.2);
  color: #fff;
}
.button-primary:hover { background: linear-gradient(135deg, #aa8af7, #8659e9); }
.button-quiet {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
  color: #d3d0db;
}
.button-quiet:hover { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.075); }
.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 170px;
  margin-left: 5px;
  color: #c7c4d0;
  font-size: 12px;
  font-weight: 600;
}
.profile-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(188, 160, 255, 0.2);
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.17);
  color: #c8b7ff;
}

.page-shell { width: min(100% - 48px, 1180px); margin: 0 auto; }
.hero { padding: 67px 0 53px; text-align: center; }
.eyebrow, .hero-meta { display: flex; align-items: center; justify-content: center; }
.eyebrow {
  width: fit-content;
  gap: 8px;
  margin: 0 auto 20px;
  padding: 7px 12px;
  border: 1px solid rgba(167, 139, 250, 0.14);
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.065);
  color: #c2b0f5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.35px;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #a78bfa; box-shadow: 0 0 10px #a78bfa; }
h1 {
  max-width: 760px;
  margin: 0 auto;
  font-size: clamp(36px, 5.4vw, 58px);
  font-weight: 800;
  letter-spacing: -2.8px;
  line-height: 1.12;
}
h1 span {
  background: linear-gradient(100deg, #c4b5fd 10%, #9d7af1 52%, #8b5cf6 100%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-copy { max-width: 570px; margin: 18px auto 18px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.hero-meta { gap: 8px; color: #777583; font-size: 11px; }
.meta-icon { color: #b79afa; font-size: 15px; }
.meta-separator { color: #45434f; }

.catalog { padding: 0 0 72px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.section-kicker { margin: 0 0 6px; color: #9d7bea; font-size: 10px; font-weight: 700; letter-spacing: 1.25px; text-transform: uppercase; }
h2 { margin: 0; font-size: 25px; font-weight: 750; letter-spacing: -0.9px; }
.heading-muted { color: #777583; font-weight: 500; }
.sort-control { position: relative; }
.sort-control select {
  appearance: none;
  min-height: 38px;
  padding: 0 34px 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: #c6c3ce;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}
.select-chevron { position: absolute; top: 8px; right: 12px; color: var(--muted); pointer-events: none; }

.search-wrap { position: relative; display: flex; height: 51px; align-items: center; }
.search-wrap input {
  width: 100%;
  height: 100%;
  padding: 0 85px 0 45px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(17, 17, 22, 0.86);
  color: var(--text);
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.search-wrap input::placeholder { color: #686775; }
.search-wrap input:focus { border-color: rgba(167, 139, 250, 0.52); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08); outline: none; }
.search-icon { position: absolute; z-index: 1; left: 17px; width: 14px; height: 14px; border: 1.7px solid #777583; border-radius: 50%; }
.search-icon::after { position: absolute; right: -5px; bottom: -3px; width: 6px; height: 1.7px; transform: rotate(45deg); border-radius: 3px; background: #777583; content: ""; }
.search-shortcut { position: absolute; right: 13px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 5px; color: #777583; font-size: 9px; }

.category-scroll { overflow-x: auto; overscroll-behavior-x: contain; margin: 20px -1px 24px; scrollbar-width: none; }
.category-scroll::-webkit-scrollbar { display: none; }
.categories { display: flex; width: max-content; min-width: 100%; gap: 7px; }
.category-chip {
  min-height: 33px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #9694a1;
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
  transition: all 150ms ease;
}
.category-chip:hover { border-color: var(--border-strong); background: var(--surface-raised); color: var(--text); }
.category-chip.selected { border-color: rgba(167, 139, 250, 0.28); background: rgba(139, 92, 246, 0.14); color: #c8b6ff; }
.category-count { margin-left: 5px; color: #777583; font-size: 9px; }
.results-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 1px 11px; color: #bbb8c4; font-size: 11px; font-weight: 650; }
.results-count { color: #777583; font-weight: 500; }
.entry-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.entry-card {
  position: relative;
  min-width: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}
.entry-card:hover { transform: translateY(-2px); border-color: var(--border); background: rgba(20, 20, 27, 0.7); }
.profile-art {
  position: relative;
  aspect-ratio: 1;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: linear-gradient(145deg, #453274, #191723 78%);
  isolation: isolate;
}
.profile-art::before, .profile-art::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
}
.profile-art::before { top: -17%; right: -14%; width: 79%; height: 79%; background: rgba(203, 174, 255, 0.26); filter: blur(1px); }
.profile-art::after { bottom: -34%; left: -13%; width: 110%; height: 78%; background: rgba(8, 8, 13, 0.52); filter: blur(6px); }
.profile-art-tone-1 { background: linear-gradient(145deg, #314f58, #151921 78%); }
.profile-art-tone-1::before { background: rgba(132, 224, 214, 0.24); }
.profile-art-tone-2 { background: linear-gradient(145deg, #63433b, #1d1719 78%); }
.profile-art-tone-2::before { background: rgba(255, 185, 143, 0.23); }
.profile-art-tone-3 { background: linear-gradient(145deg, #3e4a77, #151723 78%); }
.profile-art-tone-3::before { background: rgba(149, 178, 255, 0.24); }
.profile-art-tone-4 { background: linear-gradient(145deg, #4d3e64, #191622 78%); }
.profile-art-tone-4::before { background: rgba(226, 161, 231, 0.23); }
.profile-image {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}
.entry-card:hover .profile-image { transform: scale(1.055); }
.profile-art.has-image:not(.image-failed) .profile-fallback, .profile-art.has-image:not(.image-failed) .profile-ornament { display: none; }
.image-failed .profile-image { display: none; }
.profile-fallback {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(48px, 7vw, 100px);
  font-weight: 800;
  letter-spacing: -0.08em;
  text-shadow: 0 5px 28px rgba(0, 0, 0, 0.38);
}
.profile-ornament { position: absolute; top: 37%; left: 23%; color: rgba(255, 255, 255, 0.27); font-size: clamp(20px, 4vw, 45px); }
.profile-image-shade { position: absolute; z-index: 1; inset: 35% 0 0; background: linear-gradient(180deg, transparent, rgba(5, 5, 9, 0.86)); pointer-events: none; }
.profile-category, .profile-award {
  position: absolute;
  z-index: 2;
  top: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(13, 13, 18, 0.68);
  color: #f2effa;
  font-size: 9px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}
.profile-category { left: 8px; max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-award { right: 8px; color: #f5d477; }
.profile-caption { position: absolute; z-index: 2; right: 10px; bottom: 10px; left: 10px; }
.profile-name { margin: 0; overflow: hidden; color: #fff; font-size: clamp(12px, 1vw, 15px); font-weight: 750; letter-spacing: -0.25px; text-overflow: ellipsis; white-space: nowrap; }
.profile-handle { display: block; margin-top: 4px; overflow: hidden; color: rgba(245, 242, 251, 0.73); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.entry-description { display: -webkit-box; min-height: 45px; margin: 0 1px 9px; overflow: hidden; color: #aaa7b4; font-size: 10px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.entry-link { display: inline-block; margin: -2px 1px 9px; color: #b7a3f4; font-size: 9px; text-decoration: none; }
.entry-link:hover { color: #d0c0ff; text-decoration: underline; }
.entry-footer { display: grid; gap: 7px; padding-top: 8px; border-top: 1px solid var(--border); }
.vote-summary { color: #9b98a6; font-size: 9px; }
.vote-actions { display: flex; justify-content: space-between; gap: 5px; }
.vote-button {
  display: inline-flex;
  min-width: 0;
  height: 27px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #9996a3;
  cursor: pointer;
  font-size: 9px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.vote-button:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.07); color: var(--text); }
.vote-button.selected-up { border-color: rgba(110, 231, 183, 0.22); background: rgba(16, 185, 129, 0.11); color: var(--green); }
.vote-button.selected-down { border-color: rgba(251, 113, 133, 0.22); background: rgba(244, 63, 94, 0.1); color: var(--red); }
.vote-button:disabled { cursor: wait; opacity: 0.65; }
.pending-badge { margin-top: 8px; color: #fbbf24; font-size: 10px; font-weight: 650; }
.field-hint { margin: 6px 0 0; color: #777583; font-size: 9px; line-height: 1.5; }
.empty-state { padding: 58px 20px; text-align: center; }
.empty-icon { color: #8b5cf6; font-size: 32px; }
.empty-state h3 { margin: 12px 0 6px; font-size: 15px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.load-error { display: grid; justify-items: center; gap: 12px; padding: 42px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.load-error strong { color: var(--text); font-size: 16px; }

.moderation-view { display: grid; gap: 10px; }
.moderation-title { margin: 22px 0 2px; font-size: 17px; }
.moderation-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
.approve-button { border-color: rgba(110, 231, 183, 0.22); color: var(--green); }
.reject-button { border-color: rgba(251, 113, 133, 0.22); color: var(--red); }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 0 28px; border-top: 1px solid var(--border); color: #6e6c79; font-size: 10px; }
.footer-brand { font-size: 13px; }
.footer-brand .brand-mark { width: 26px; height: 26px; border-radius: 8px; font-size: 14px; }
.footer-link { padding: 6px 0; font-size: 10px; }

.modal { width: min(100% - 28px, 460px); max-height: min(90vh, 760px); padding: 0; overflow: auto; border: 1px solid var(--border-strong); border-radius: 17px; background: #111116; color: var(--text); box-shadow: 0 24px 90px rgba(0, 0, 0, 0.65); }
.modal::backdrop { background: rgba(4, 4, 8, 0.75); backdrop-filter: blur(5px); }
.modal-card { position: relative; padding: 27px; }
.modal-close { position: absolute; top: 16px; right: 17px; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255, 255, 255, 0.03); color: #9e9ba8; cursor: pointer; font-size: 20px; line-height: 1; }
.modal-icon { display: grid; width: 37px; height: 37px; place-items: center; margin-bottom: 16px; border: 1px solid rgba(167, 139, 250, 0.2); border-radius: 11px; background: rgba(139, 92, 246, 0.12); color: #c4b5fd; font-size: 16px; }
.modal-card h2 { margin-bottom: 8px; font-size: 22px; }
.modal-copy { margin: 0 0 20px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.field-label { display: block; margin: 15px 0 7px; color: #cfccd6; font-size: 10px; font-weight: 650; }
.field-label span { color: #b08cfb; }
.text-field { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: #0c0c11; color: var(--text); font-size: 11px; }
.text-field::placeholder { color: #656370; }
.file-field { padding: 8px; color: #aaa7b4; }
.file-field::file-selector-button { margin-right: 10px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: rgba(139, 92, 246, 0.13); color: #c8b6ff; cursor: pointer; font-size: 10px; }
.upload-preview { display: block; width: 100px; height: 100px; margin-top: 12px; border: 1px solid var(--border-strong); border-radius: 12px; object-fit: cover; }
.textarea-field { resize: vertical; min-height: 72px; }
.submit-button { width: 100%; margin-top: 18px; }
.form-error { margin: 12px 0 0; color: var(--red); font-size: 11px; }
.faq-list { display: grid; gap: 6px; margin-top: 22px; }
.faq-list details { padding: 13px 0; border-top: 1px solid var(--border); }
.faq-list summary { color: #e3e1e9; cursor: pointer; font-size: 12px; font-weight: 650; }
.faq-list details p { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.settings-card .submit-button { margin-top: 5px; }
.toast-region { position: fixed; z-index: 10; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 12px 15px; border: 1px solid var(--border-strong); border-radius: 10px; background: #1b1a22; box-shadow: 0 9px 30px rgba(0, 0, 0, 0.35); color: #e8e5ee; font-size: 11px; line-height: 1.5; animation: toast-in 180ms ease both; }
.toast.error { border-color: rgba(251, 113, 133, 0.28); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 700px) {
  .topbar { height: 62px; padding: 0 17px; }
  .desktop-nav { display: none; }
  .topbar-actions { gap: 6px; }
  .button { min-height: 37px; padding: 0 11px; font-size: 11px; }
  .add-label { display: none; }
  .profile-chip { max-width: 80px; font-size: 10px; }
  .page-shell { width: min(100% - 32px, 620px); }
  .hero { padding: 51px 0 40px; }
  h1 { max-width: 440px; font-size: clamp(34px, 9vw, 46px); letter-spacing: -2px; }
  .hero-copy { max-width: 420px; margin-top: 14px; font-size: 12px; }
  .section-heading { margin-bottom: 16px; }
  h2 { font-size: 22px; }
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .entry-card { padding: 7px; }
  .profile-art { margin-bottom: 9px; }
  .entry-description { min-height: 45px; margin: 0 1px 8px; font-size: 9px; }
  .profile-category, .profile-award { top: 6px; padding: 5px 6px; font-size: 8px; }
  .profile-category { left: 6px; }
  .profile-award { right: 6px; }
  .profile-caption { right: 7px; bottom: 8px; left: 7px; }
  .profile-name { font-size: 12px; }
  .profile-handle { font-size: 8px; }
  .vote-button { padding: 0 5px; font-size: 8px; }
  .vote-summary { font-size: 8px; }
  .category-scroll { margin-top: 16px; margin-bottom: 21px; }
  .footer { flex-wrap: wrap; }
}

@media (max-width: 380px) {
  .page-shell { width: calc(100% - 24px); }
  .hero { padding-top: 42px; }
  .profile-chip { display: none !important; }
  .entry-grid { gap: 5px; }
  .entry-card { padding: 5px; }
  .profile-art { border-radius: 8px; }
  .vote-button { gap: 3px; padding: 0 4px; }
  .section-heading { align-items: center; }
  .sort-control select { min-height: 35px; font-size: 10px; }
  .modal-card { padding: 22px 18px; }
}

@media (min-width: 701px) and (max-width: 1100px) {
  .entry-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
}

@media (min-width: 701px) and (max-width: 900px) {
  .entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
