:root {
  --bg: #0f1620;
  --bg-card: #1a2332;
  --text: #e8edf3;
  --muted: #8fa1b5;
  --accent: #2aabee;
  --accent-dark: #1d8fd1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid #263345;
  padding: 12px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 700; color: var(--text); text-decoration: none; }
.topbar nav a { color: var(--text); text-decoration: none; margin-left: 16px; }

main { padding: 32px 0; min-height: 60vh; }
section { margin-top: 40px; }
h1 { margin-bottom: 12px; }
h2 { margin-bottom: 16px; }

.hero { text-align: center; padding: 32px 0; }
.hero p { color: var(--muted); font-size: 1.1rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid #263345;
  border-radius: 12px;
  padding: 20px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--accent); }
.card h3 { margin-bottom: 8px; font-size: 1.05rem; }
.card p { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.count { color: var(--accent); font-size: 0.85rem; }

.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid #263345;
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-big { padding: 14px 32px; font-size: 1.1rem; margin-top: 20px; }

.search { display: flex; gap: 8px; margin: 16px 0 24px; }
.search input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #263345;
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
}

.group-detail { max-width: 640px; }
.group-detail .meta { color: var(--muted); margin: 8px 0 16px; }
.group-detail .description { margin-bottom: 8px; white-space: pre-wrap; }

.pagination { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 24px; }

.empty { color: var(--muted); }
.empty a { color: var(--accent); }

.nsfw-warning {
  background: #3a2530;
  border: 1px solid #6b3648;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.adult-section { margin-top: 40px; }
.adult-card {
  border-color: #6b3648;
  background: #241722;
  text-align: center;
  padding: 32px 20px;
}
.adult-card:hover { border-color: #e0526e; }
.adult-card h3 { font-size: 1.4rem; }
.adult-card .adult-subs { color: var(--muted); font-size: 0.9rem; }
.adult-card .count { color: #e0526e; }

.steps { margin-left: 24px; }
.steps li { margin-bottom: 8px; }

a { color: var(--accent); }
.editor { display: grid; gap: 10px; max-width: 700px; margin: 24px 0; }
.editor input:not([type=radio]):not([type=hidden]), .editor textarea, select { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #40516a; background: var(--bg); color: var(--text); font: inherit; }
.editor textarea { resize: vertical; }
.editor label, legend { font-weight: 600; }
fieldset { border: 1px solid #40516a; border-radius: 8px; padding: 16px; }
.mode { display: block; margin: 12px 0; font-weight: 400 !important; }
.mode input { margin-right: 8px; }
.mode-exchange { padding: 12px; border: 1px solid #3789bf; border-radius: 10px; background: rgba(55, 137, 191, .12); }
.mode-exchange:has(input:checked) { outline: 1px solid #3789bf; }
.editor .btn { justify-self: start; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.inline-form { display: inline-block; margin-left: 10px; }
.notice { padding: 12px 16px; background: #22334a; border: 1px solid #40516a; border-radius: 8px; margin: 16px 0; }
.notice.error { border-color: #e08080; }
.muted, .verification { color: var(--muted); font-size: .85rem; }
.verification { margin-top: 12px; }
.verified { color: #8de0ad; }
.temporary_error, .pending { color: #e5c985; }
.unavailable { color: #f29b9b; }
.badge { display: inline-block; color: var(--accent); font-size: .8rem; margin-bottom: 8px; }
.manage-card { margin: 24px 0; }
.manage-card h2 { margin-bottom: 8px; }
.listing-title { margin-top: 24px; }
.management-link { margin: 20px 0; }
.avatar { display: block; border-radius: 50%; object-fit: cover; margin-bottom: 14px; background: #22334a; }
.avatar-large { width: 96px; height: 96px; }
.member-filter { min-width: 130px; flex: 1; color: var(--muted); font-size: .8rem; }
.member-filter input { display: block; width: 100%; margin-top: 4px; }
.search { flex-wrap: wrap; align-items: flex-end; }
.search > input { min-width: 180px; }
.search > select { min-height: 44px; }
.btn-danger { background: #853f4b; border-color: #a35763; }
.delete-link { color: #f29b9b; display: inline-block; margin-right: 18px; }
.report-section { max-width: 700px; }
summary { cursor: pointer; color: var(--accent); padding: 8px 0; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.rating-summary { color: #e5c985 !important; font-size: .85rem; margin: 8px 0; }
.rating-options { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0; }
.rating-options label { cursor: pointer; white-space: nowrap; }
.history-section { max-width: 760px; }
.growth-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.history-chart { background: var(--bg-card); border-radius: 12px; padding: 16px; margin: 16px 0; }
.history-chart svg { display: block; width: 100%; height: auto; }
.history-chart text { fill: #8fa1b5; font-size: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 12px 0; }
th,td { padding: 8px; text-align: left; border-bottom: 1px solid #40516a; }
@media(max-width:480px) { .growth-grid { grid-template-columns: minmax(0,1fr); } .rating-options { gap: 12px; } }
.search select { width: auto; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) {
  .topbar .container { align-items: flex-start; flex-direction: column; gap: 12px; }
  .topbar nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  .topbar nav a { margin: 0; }
  .inline-form { margin-left: 0; }
  .search { flex-wrap: wrap; }
  .search input { min-width: 0; flex-basis: 100%; }
  .search select { flex: 1; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { width: 100%; text-align: center; }
  .actions > * { width: 100%; }
}

.footer {
  border-top: 1px solid #263345;
  padding: 24px 0;
  margin-top: 48px;
  color: var(--muted);
  text-align: center;
}
.footer a { color: var(--accent); }
