:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #11151d;
  --soft: #191f2a;
  --line: #262e3d;
  --text: #f4f6fb;
  --muted: #99a4b7;
  --accent: #8b5cf6;
  --accent2: #22d3ee;
  --danger: #fb7185;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 50% -20%, #281b55 0, transparent 38rem), var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
}
a { color: var(--accent2); text-decoration: none; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(14px, calc((100vw - 680px) / 2));
  border-bottom: 1px solid #ffffff12;
  background: #090b10cc;
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { color: var(--text); font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.brand-mascot { width: 34px; height: 34px; object-fit: contain; }
.account { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.who { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { width: min(680px, 100% - 24px); margin: 0 auto; padding-bottom: 60px; }

.tabs-row { display: flex; gap: 6px; margin: 14px 0; }
.tab {
  flex: 1; border: 1px solid var(--line); background: var(--soft); color: var(--muted);
  padding: 11px; border-radius: 10px; font-weight: 700;
}
.tab.active { color: var(--text); border-color: var(--accent); background: var(--panel); }

.search-row { margin: 4px 0 10px; }
input, textarea {
  width: 100%; background: #090b10; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 12px; font: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

.feed-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.btn {
  border: 1px solid var(--line); background: var(--soft); color: var(--text);
  padding: 9px 13px; border-radius: 9px; font-weight: 700;
}
.btn:hover { border-color: #64748b; }
.btn.primary { border: 0; background: linear-gradient(135deg, var(--accent), #6d28d9); }
.btn.ghost { background: transparent; }
.btn.active { color: var(--accent); border-color: var(--accent); }
.wide { width: 100%; margin-top: 8px; }
.link { background: none; border: 0; color: var(--accent2); padding: 0; margin-top: 12px; font-size: 14px; }

.feed { display: grid; grid-template-columns: 1fr; gap: 16px; }
.post { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 34px #0004; }
.post-meta { display: flex; gap: 10px; align-items: center; padding: 13px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); font-weight: 900; }
.post-meta p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.author-btn { border: 0; background: transparent; color: var(--text); font-weight: 800; padding: 0; }
.post video { width: 100%; aspect-ratio: 16/9; display: block; background: #030406; }
.post-body { padding: 13px; }
.post h3 { margin: 0 0 10px; font-size: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { padding: 7px 11px; font-size: 13px; }
.comments { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 11px; }
.comment-list { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.comment-list p { margin: 0; }
.comment-list strong { color: var(--text); }
.comment-form { display: flex; gap: 8px; margin-top: 11px; }
.comment-form input { flex: 1; }
.more { display: block; margin: 22px auto 0; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gallery-item { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 13px; padding: 6px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 50px 0; }
.error { min-height: 19px; color: var(--danger); margin: 0; font-size: 13px; }
.notice-list { display: grid; gap: 10px; max-height: 60vh; overflow: auto; margin-top: 14px; }
.notice { padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.notice strong { color: var(--text); }
.profile-stats { display: flex; gap: 18px; margin: 14px 0; }

dialog {
  width: min(430px, calc(100% - 28px)); background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 24px 90px #000b;
}
dialog::backdrop { background: #03040ad9; backdrop-filter: blur(5px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; font-size: 19px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; }
.dialog-head .tabs { display: flex; border-bottom: 1px solid var(--line); margin: 16px 0; }
#auth-form { display: grid; gap: 12px; margin-top: 8px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.instructions { color: var(--muted); line-height: 1.6; }

@media (min-width: 700px) {
  .feed { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
