/* ===== Slate — dark grey theme ===== */
/* mobile top bar is hidden on desktop; shown via media query below */
.mobile-bar { display: none; }
.nav-backdrop { display: none; }

:root {
  --bg: #1e1f22;
  --panel: #2b2d31;
  --panel-2: #35373c;
  --sidebar: #232428;
  --border: #3f4147;
  --text: #d6d8dd;
  --text-dim: #8e9297;
  --accent: #6573c9;
  --accent-hover: #7683d6;
  --accent-soft: #8a9dff;
  --gold: #d4a72c;
  --danger: #d05b54;
  --ok: #4fa36a;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
.hidden { display: none !important; }

/* ---- buttons / inputs ---- */
.btn {
  border: none; border-radius: 8px; padding: 9px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  transition: background .15s;
}
.btn:hover { background: var(--border); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.full { width: 100%; margin-top: 12px; }
.btn.subtle { font-size: 12px; padding: 6px 10px; }
.btn.danger { color: var(--danger); }
.btn.social {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--panel-2); border: 1px solid var(--border);
  text-decoration: none; margin-top: 10px;
}
.btn.social:hover { background: var(--border); }
.gold-btn { background: linear-gradient(135deg, #e3b53a, #b8891a); color: #1e1f22; }
.gold-btn:hover { filter: brightness(1.07); }
.icon-btn {
  background: none; border: none; cursor: pointer; font-size: 15px;
  color: var(--text-dim); border-radius: 6px; padding: 4px 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,.07); color: var(--text); }
.icon-btn.gold { color: var(--gold); }
.icon-btn.big { padding: 6px; }
input[type=text], input[type=password], input[type=tel], input[type=date], textarea, select {
  width: 100%; background: #1a1b1e; border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; font-size: 14px;
  color: var(--text); font-family: inherit; resize: none;
  color-scheme: dark;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input + input, input + .btn { margin-top: 10px; }
.error {
  background: #3d2626; color: #e88f89; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; margin: 8px 0;
}
.note {
  background: var(--panel-2); color: var(--text-dim); border-radius: 8px;
  padding: 8px 12px; font-size: 12.5px; margin: 10px 0;
}
.field-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--text-dim); text-transform: uppercase; margin: 14px 0 5px;
}

/* ---- animated background (age gate / login) ---- */
#fx { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; }
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.7'/></svg>");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 25% { transform: translate(-3%,2%); }
  50% { transform: translate(2%,-3%); } 75% { transform: translate(-2%,-2%); } 100% { transform: translate(0,0); }
}

/* ---- custom login background (set in admin console) ---- */
.login-bg { position: fixed; inset: 0; z-index: 0; }
.login-bg img, .login-bg video { width: 100%; height: 100%; object-fit: cover; }
.login-bg::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(18,19,22,.55); /* darken so the login card stays readable */
}

/* ---- auth / age screens ---- */
.auth-screen {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #26272b, var(--bg));
  position: relative; z-index: 2;
}
#ageScreen, #authScreen, #ageBlocked { background: transparent; }
.auth-card {
  width: 360px; max-width: 92vw; background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px; padding: 30px 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  max-height: 92vh; overflow-y: auto;
}
.auth-card.frosted {
  background: rgba(43,45,49,.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-color: rgba(255,255,255,.09);
}
.lang-select {
  width: auto; float: right; padding: 5px 8px; font-size: 12px;
  margin: -6px -6px 0 0;
}
.logo { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.logo.small { font-size: 17px; }
.tagline { color: var(--text-dim); font-size: 13px; margin: 4px 0 18px; }
.auth-switch { margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.auth-switch a { color: var(--accent-soft); text-decoration: none; }
.age-note { margin-top: 14px; font-size: 12px; color: var(--text-dim); }
.divider {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 4px;
  color: var(--text-dim); font-size: 12px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---- layout ---- */
.app { display: flex; height: 100%; }
.sidebar {
  width: 240px; min-width: 240px; background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sidebar-head {
  padding: 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.admin-link {
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  color: var(--accent-soft); text-decoration: none;
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px;
}
.admin-link:hover { background: var(--panel-2); }
.locked-banner {
  margin: 10px 12px 0; padding: 7px 10px; border-radius: 8px;
  background: #3d2626; color: #e88f89; font-size: 12px; font-weight: 600;
}
.topics-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; color: var(--text-dim);
}
.topic-list { flex: 1; overflow-y: auto; padding: 0 8px; }
.topic-list.album-list { flex: 0 1 auto; max-height: 32%; }

/* section separator in the sidebar */
.side-sep { height: 1px; background: var(--border); margin: 12px 14px 2px; flex-shrink: 0; }

/* INFO category (Rules / Guidelines / Updates) — pinned at the very top, gold outline */
.info-cat {
  margin: 12px 12px 0; padding: 9px 10px 10px;
  border: 1px solid var(--gold); border-radius: 10px;
  background: rgba(212,167,44,.06);
  box-shadow: 0 0 10px rgba(212,167,44,.12) inset;
  display: flex; flex-direction: column; gap: 5px; flex-shrink: 0;
}
.info-cat-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  color: var(--gold); margin-bottom: 2px;
}
.info-cat .topbar-btn {
  text-align: left; border-color: rgba(212,167,44,.4); color: var(--gold);
  background: rgba(212,167,44,.05);
}
.info-cat .topbar-btn:hover { background: rgba(212,167,44,.16); color: #f0c75e; }
.topic-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 7px; cursor: pointer;
  color: var(--text-dim); font-size: 14.5px; margin-bottom: 1px;
}
.topic-item:hover { background: var(--panel-2); color: var(--text); }
.topic-item.active { background: var(--panel-2); color: var(--text); font-weight: 600; }
.topic-item .hash { color: var(--text-dim); font-weight: 700; width: 14px; text-align: center; }
.topic-item .tname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-item .count { font-size: 11px; color: var(--text-dim); }

.user-card {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border);
  background: #1f2023;
}
.user-card-info { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.uname { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.utag { font-size: 11px; color: var(--text-dim); }

/* ---- main ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.topic-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px; border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.topic-head-icon { font-size: 22px; font-weight: 700; color: var(--text-dim); }
.topic-head-name { font-weight: 700; font-size: 16px; }
.topic-head-desc { font-size: 12.5px; color: var(--text-dim); }

.feed { flex: 1; overflow-y: auto; padding: 18px 20px; }
.feed-empty { color: var(--text-dim); text-align: center; margin-top: 60px; font-size: 14px; }

.msg { display: flex; gap: 12px; padding: 7px 0; }
.msg:hover { background: rgba(255,255,255,.02); }
.msg.pending { opacity: .55; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 8px; }
.msg-name { font-weight: 700; font-size: 14.5px; cursor: pointer; }
.msg-name:hover { text-decoration: underline; }
.msg-time { font-size: 11.5px; color: var(--text-dim); }
.msg-text { font-size: 14.5px; margin-top: 2px; white-space: pre-wrap; word-wrap: break-word; }
.msg-del { opacity: 0; transition: opacity .1s; }
.msg:hover .msg-del { opacity: 1; }
.pending-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  background: #3d3524; color: #d4a72c; border-radius: 5px; padding: 2px 6px;
}
.msg-media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.msg-media img, .msg-media video {
  max-width: 340px; max-height: 260px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); object-fit: cover;
}

/* ---- composer ---- */
.composer { padding: 12px 20px 16px; border-top: 1px solid var(--border); background: var(--panel); }
.composer-row { display: flex; align-items: flex-end; gap: 10px; }
.composer textarea { flex: 1; max-height: 140px; }
.mod-note { font-size: 11.5px; color: var(--text-dim); margin-top: 7px; }
.attach-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.attach-chip { position: relative; }
.attach-chip img, .attach-chip video {
  width: 74px; height: 74px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border);
}
.attach-chip .rm {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: var(--danger); color: #fff;
  font-size: 11px; cursor: pointer; line-height: 1;
}

/* ---- avatars ---- */
.avatar { border-radius: 50%; object-fit: cover; cursor: pointer; background: var(--panel-2); }
.avatar.sm { width: 32px; height: 32px; }
.avatar.md { width: 40px; height: 40px; }
.avatar.lg { width: 84px; height: 84px; border: 4px solid var(--panel); }

/* ---- badges ---- */
.badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  border-radius: 5px; padding: 2px 7px; background: var(--panel-2); color: var(--text-dim);
}
.badge.gold { background: #3d3524; color: var(--gold); }
.badge.role-admin { background: #3d2626; color: #e88f89; }
.badge.role-mod { background: #24333d; color: #6fb3d6; }
.gold-text { color: var(--gold); }

.gradient {
  background: linear-gradient(90deg, #8a9dff, #c98af0, #8a9dff);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

/* ---- modals ---- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 85;
}
.modal {
  position: relative; width: 400px; max-width: 94vw; max-height: 90vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.modal h2 { font-size: 19px; margin-bottom: 4px; }
.modal-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 12px; }
.modal-close {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  color: var(--text-dim); font-size: 20px; cursor: pointer; border-radius: 6px;
  width: 28px; height: 28px; line-height: 1;
}
.modal-close:hover { background: var(--panel-2); color: var(--text); }

.perks { list-style: none; margin: 10px 0; }
.perks li { padding: 6px 0 6px 18px; font-size: 14px; position: relative; }
.perks li::before { content: "+"; position: absolute; left: 0; color: var(--gold); font-weight: 800; }
.pay-form input { margin-top: 10px; }
.pay-row { display: flex; gap: 10px; }
.pay-row input { flex: 1; }

.premium-box { border: 1px solid #3d3524; border-radius: 10px; padding: 12px; margin-top: 14px; }
.premium-box-title { font-size: 13px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.color-row { display: flex; gap: 14px; align-items: center; margin: 8px 0; font-size: 13px; }
.color-row label { display: flex; align-items: center; gap: 8px; }
.color-row input[type=color] { width: 34px; height: 26px; border: none; background: none; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0; }
.check-row input { width: auto; }

/* ---- profile editing ---- */
.banner-edit {
  height: 90px; border-radius: 10px; background: var(--panel-2) center/cover;
  display: flex; align-items: center; justify-content: center; cursor: grab;
  margin-top: 12px; border: 1px dashed var(--border);
  touch-action: none; user-select: none;
}
.banner-edit:active { cursor: grabbing; }
.banner-hint { font-size: 12px; color: var(--text-dim); background: rgba(0,0,0,.45); padding: 3px 8px; border-radius: 6px; }
.avatar-edit-row { display: flex; align-items: center; gap: 14px; margin-top: -26px; padding-left: 14px; }
.avatar-edit { position: relative; width: 72px; height: 72px; cursor: grab; touch-action: none; user-select: none; }
.avatar-edit:active { cursor: grabbing; }
.avatar-edit img { pointer-events: none; -webkit-user-drag: none; }
.avatar-edit img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--panel); background: var(--panel-2); }
.avatar-hint {
  position: absolute; bottom: 0; right: 0; font-size: 10px;
  background: var(--accent); color: #fff; border-radius: 6px; padding: 2px 6px;
}
.avatar-edit-name { font-weight: 700; font-size: 16px; margin-top: 18px; }

/* ---- profile popup ---- */
.profile-pop { padding: 0; overflow: hidden; }
.profile-banner { height: 110px; background: var(--panel-2) center/cover; }
.profile-body { padding: 0 20px 20px; margin-top: -42px; }
.profile-name { font-size: 20px; font-weight: 800; margin-top: 8px; }
.profile-bio { margin-top: 10px; font-size: 14px; white-space: pre-wrap; }
.profile-joined { margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.profile-body .badge { margin-top: 6px; margin-right: 6px; }

/* ---- lightbox / image viewer (zoom + pan + download) ---- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 95;
  display: flex; flex-direction: column;
}
.lightbox-toolbar {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-top)); flex-shrink: 0; z-index: 2;
}
.lb-btn {
  min-width: 38px; height: 38px; padding: 0 10px; border-radius: 9px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  color: #fff; font-size: 18px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lightbox-stage {
  flex: 1; position: relative; overflow: hidden; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; cursor: zoom-out;
}
.lightbox.zoomed .lightbox-stage { cursor: grab; }
.lightbox-inner {
  position: relative; display: inline-block; line-height: 0;
  transition: transform .08s ease-out; will-change: transform; touch-action: none;
}
.lightbox img { max-width: 96vw; max-height: 82vh; border-radius: 6px; display: block; -webkit-user-drag: none; user-select: none; }
.lightbox-inner .wm { position: absolute; right: 14px; bottom: 14px; font-weight: 800; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.75), 0 0 2px rgba(0,0,0,.5); pointer-events: none; }

/* ---- top bar (Rules / Guidelines / Updates) ---- */
.topbar {
  display: flex; gap: 8px; padding: 8px 20px;
  background: #232428; border-bottom: 1px solid var(--border);
}
.topbar-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: .07em;
  padding: 5px 12px; cursor: pointer;
}
.topbar-btn:hover { background: var(--panel-2); color: var(--text); }
.info-body { white-space: pre-wrap; font-size: 14px; margin-top: 10px; color: var(--text); }

/* ---- online sidebar ---- */
.online-bar {
  width: 200px; min-width: 200px; background: var(--sidebar);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
}
.online-list { flex: 1; overflow-y: auto; padding: 4px 10px; }
.online-group {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em;
  color: var(--text-dim); margin: 12px 4px 4px;
}
.online-group.g-admin { color: #e88f89; }
.online-group.g-mod { color: #6fb3d6; }
.online-user {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px;
  border-radius: 7px; cursor: pointer;
}
.online-user:hover { background: var(--panel-2); }
.online-user .avatar { width: 26px; height: 26px; }
.online-user .oname { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-left: auto; flex-shrink: 0; }

/* ---- reactions ---- */
.reacts { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.react-chip {
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 999px; padding: 2px 9px; font-size: 12px; cursor: pointer;
  color: var(--text-dim); display: inline-flex; align-items: center; gap: 5px;
  transition: border-color .1s, color .1s;
}
.react-chip:hover { border-color: var(--accent); color: var(--text); }
.react-chip.mine { border-color: var(--accent); background: rgba(101,115,201,.15); color: var(--accent-soft); }
.react-chip .rc { font-weight: 700; }
.react-chip .re { font-size: 14px; line-height: 1; }

/* the "+" add-reaction button only appears when hovering a message/card */
.add-react { opacity: 0; transition: opacity .1s; }
.msg:hover .add-react, .album-card:hover .add-react { opacity: 1; }

/* emoji reaction picker */
.react-picker {
  position: fixed; z-index: 80;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; display: flex; gap: 2px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  animation: toastIn .12s ease;
}
.react-picker button {
  background: none; border: none; cursor: pointer;
  font-size: 19px; line-height: 1; border-radius: 8px; padding: 6px 7px;
}
.react-picker button:hover { background: var(--panel-2); transform: scale(1.15); }

/* ---- album (* forum) ---- */
.album-bar { margin-left: auto; display: flex; align-items: center; font-size: 12.5px; color: var(--text-dim); }
.album-bar label { display: flex; align-items: center; gap: 8px; }
.album-bar select { width: auto; padding: 6px 10px; font-size: 13px; }
.album-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.album-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
}
.album-card.hot { border-color: #e8912d; box-shadow: 0 0 14px rgba(232,145,45,.35); }
.album-thumb { position: relative; cursor: pointer; background: #17181a; }
.album-thumb img, .album-thumb video { width: 100%; height: 150px; object-fit: cover; display: block; }
.album-views {
  position: absolute; bottom: 6px; left: 6px; font-size: 11px; font-weight: 700;
  background: rgba(0,0,0,.65); color: #fff; border-radius: 6px; padding: 2px 7px;
}
.album-card.hot .album-views { background: #e8912d; color: #1e1f22; }
.hot-tag {
  position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  background: #e8912d; color: #1e1f22; border-radius: 5px; padding: 2px 6px;
}
.album-body { padding: 9px 11px 11px; }
.album-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); }
.album-meta .avatar { width: 20px; height: 20px; }
.album-meta .aname { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-caption { font-size: 13px; margin-top: 5px; white-space: pre-wrap; word-wrap: break-word; }
.album-card .pending-tag { margin: 6px 11px 0; align-self: flex-start; }

/* ---- replies ---- */
.reply-bar {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
  background: var(--panel-2); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 6px 10px; font-size: 12.5px; color: var(--text-dim);
}
.reply-bar b { color: var(--accent-soft); }
.reply-bar #replySnippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.reply-quote {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim);
  border-left: 2px solid var(--accent); padding: 2px 8px; margin-bottom: 3px;
  background: rgba(101,115,201,.07); border-radius: 4px; cursor: pointer;
  max-width: 480px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.reply-quote b { color: var(--accent-soft); }
.msg-reply-btn { opacity: 0; transition: opacity .1s; }
.msg:hover .msg-reply-btn { opacity: 1; }

/* ---- notifications ---- */
.notif-btn { position: relative; }
.notif-count {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; border-radius: 8px; font-size: 10px;
  font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.notif-list { max-height: 50vh; overflow-y: auto; margin-top: 10px; }
.notif-item {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  margin-bottom: 8px; font-size: 13.5px; background: var(--bg);
}
.notif-item.unread { border-color: var(--accent); }
.notif-item .n-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel); border: 1px solid var(--accent); border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  animation: toastIn .2s ease; max-width: 300px;
}
.toast b { color: var(--accent-soft); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---- album filters / upload / detail ---- */
.filter-tabs { display: flex; gap: 4px; margin-right: 12px; }
.filter-tab {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); font-size: 12px; font-weight: 700; padding: 5px 11px; cursor: pointer;
}
.filter-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.album-bar { gap: 12px; }
.tag-chip {
  display: inline-block; background: rgba(101,115,201,.15); color: var(--accent-soft);
  border-radius: 999px; padding: 2px 10px; font-size: 11.5px; font-weight: 700;
}
.album-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-card .card-del {
  position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #e88f89;
  border: none; border-radius: 6px; padding: 3px 6px; cursor: pointer; opacity: 0; transition: opacity .1s;
}
.album-thumb:hover .card-del { opacity: 1; }
.upload-drop {
  border: 2px dashed var(--border); border-radius: 10px; padding: 18px;
  text-align: center; color: var(--text-dim); cursor: pointer; margin-top: 12px; font-size: 13.5px;
}
.upload-drop:hover { border-color: var(--accent); color: var(--text); }
.upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.up-chip { position: relative; width: 84px; height: 84px; }
.up-chip img, .up-chip video { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.up-chip .rm {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: var(--danger); color: #fff;
  font-size: 11px; cursor: pointer; line-height: 1;
}
/* multi-item album count badge */
.album-count {
  position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,.65); color: #fff; border-radius: 6px; padding: 2px 7px;
  font-size: 11px; font-weight: 700;
}
.album-thumb:hover .card-del + .album-count, .album-card:hover .album-count { opacity: 1; }
/* detail gallery (horizontal swipe) */
.detail-media { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
.detail-slide { position: relative; flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; background: #000; }
.detail-slide img { cursor: zoom-in; }
.detail-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; pointer-events: none; }
.detail-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); }
.detail-dots .dot.on { background: #fff; }
.detail-modal { width: 560px; padding: 0; overflow: hidden; }
.detail-media { background: #000; text-align: center; }
.detail-media img, .detail-media video { max-width: 100%; max-height: 46vh; display: block; margin: 0 auto; }
.detail-body { padding: 16px 20px 20px; }
.detail-toprow { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detail-title { font-size: 18px; font-weight: 800; }
.detail-votes { display: flex; gap: 8px; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-dim); font-size: 13px; font-weight: 700; padding: 6px 12px; cursor: pointer;
}
.vote-btn.mine-like { border-color: var(--ok); color: #7fce9d; background: rgba(79,163,106,.12); }
.vote-btn.mine-dislike { border-color: var(--danger); color: #e88f89; background: rgba(208,91,84,.12); }
.detail-bio { font-size: 14px; margin-top: 10px; white-space: pre-wrap; }
.detail-stats { font-size: 12px; color: var(--text-dim); margin-top: 8px; }
.detail-comments-head { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); margin: 14px 0 8px; }
.detail-comments { max-height: 180px; overflow-y: auto; }
.comment-item { display: flex; gap: 8px; padding: 6px 0; font-size: 13.5px; }
.comment-item .avatar { width: 24px; height: 24px; }
.comment-item .c-name { font-weight: 700; margin-right: 6px; }
.comment-item .c-time { font-size: 11px; color: var(--text-dim); margin-left: 6px; }
.comment-row { display: flex; gap: 8px; margin-top: 10px; }
.comment-row input { flex: 1; }

/* ---- premium avatar decorations (animated color auras) ---- */
.avatar.deco-ember, .avatar.deco-frost, .avatar.deco-toxic, .avatar.deco-rainbow, .avatar.deco-void {
  position: relative; z-index: 1;
}
.avatar.deco-ember  { animation: aura-ember 1.8s ease-in-out infinite; }
.avatar.deco-frost  { animation: aura-frost 2.6s ease-in-out infinite; }
.avatar.deco-toxic  { animation: aura-toxic 1.6s ease-in-out infinite; }
.avatar.deco-void   { animation: aura-void 2.2s ease-in-out infinite; }
.avatar.deco-rainbow{ animation: aura-rainbow 3s linear infinite; }
@keyframes aura-ember {
  0%,100% { box-shadow: 0 0 4px 1px rgba(255,120,30,.7), 0 0 11px 2px rgba(255,60,0,.4); }
  50%     { box-shadow: 0 0 9px 3px rgba(255,160,50,.95), 0 0 22px 7px rgba(255,80,0,.55); }
}
@keyframes aura-frost {
  0%,100% { box-shadow: 0 0 5px 1px rgba(120,200,255,.7), 0 0 12px 2px rgba(80,150,255,.4); }
  50%     { box-shadow: 0 0 10px 3px rgba(160,230,255,.95), 0 0 22px 6px rgba(90,170,255,.55); }
}
@keyframes aura-toxic {
  0%,100% { box-shadow: 0 0 4px 1px rgba(120,255,90,.7), 0 0 11px 2px rgba(60,220,40,.4); }
  50%     { box-shadow: 0 0 10px 3px rgba(170,255,120,.95), 0 0 22px 7px rgba(70,230,50,.6); }
}
@keyframes aura-void {
  0%,100% { box-shadow: 0 0 5px 1px rgba(180,90,255,.7), 0 0 13px 3px rgba(120,40,220,.45); }
  50%     { box-shadow: 0 0 11px 4px rgba(200,120,255,.95), 0 0 24px 8px rgba(130,50,230,.6); }
}
@keyframes aura-rainbow {
  0%   { box-shadow: 0 0 9px 3px rgba(255,60,60,.85); }
  20%  { box-shadow: 0 0 9px 3px rgba(255,180,40,.85); }
  40%  { box-shadow: 0 0 9px 3px rgba(70,230,90,.85); }
  60%  { box-shadow: 0 0 9px 3px rgba(60,200,255,.85); }
  80%  { box-shadow: 0 0 9px 3px rgba(150,90,255,.85); }
  100% { box-shadow: 0 0 9px 3px rgba(255,60,60,.85); }
}

/* decoration picker in settings */
.deco-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.deco-opt {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-dim); font-size: 12.5px; font-weight: 600; padding: 6px 12px; cursor: pointer;
}
.deco-opt:hover { color: var(--text); }
.deco-opt.active { border-color: var(--gold); color: var(--gold); background: rgba(212,167,44,.1); }
.deco-dot { width: 14px; height: 14px; border-radius: 50%; background: #555; display: inline-block; }
.deco-dot.deco-ember   { animation: aura-ember 1.8s ease-in-out infinite; background: #ff8a2e; }
.deco-dot.deco-frost   { animation: aura-frost 2.6s ease-in-out infinite; background: #8fd0ff; }
.deco-dot.deco-toxic   { animation: aura-toxic 1.6s ease-in-out infinite; background: #86ff64; }
.deco-dot.deco-rainbow { animation: aura-rainbow 3s linear infinite; background: #ff6b6b; }
.deco-dot.deco-void    { animation: aura-void 2.2s ease-in-out infinite; background: #b45aff; }

/* ---- drag & drop upload ---- */
.drop-overlay {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(30,31,34,.82); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.drop-inner {
  border: 2.5px dashed var(--accent-soft); border-radius: 16px; padding: 40px 60px;
  color: var(--accent-soft); text-align: center; font-size: 16px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: rgba(101,115,201,.08);
}
.upload-drop.drag { border-color: var(--accent); color: var(--text); background: rgba(101,115,201,.12); }

/* ---- @mentions ---- */
.mention { color: var(--accent-soft); background: rgba(101,115,201,.16); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention.me { color: #f0c75e; background: rgba(212,167,44,.18); }
.mention-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; max-height: 220px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.mention-opt { display: flex; align-items: center; gap: 9px; padding: 7px 10px; cursor: pointer; font-size: 14px; }
.mention-opt .avatar { width: 26px; height: 26px; }
.mention-opt:hover, .mention-opt.active { background: var(--panel-2); }

/* ---- watermark on photos/videos ---- */
.media-item { position: relative; display: inline-block; line-height: 0; }
.wm {
  position: absolute; right: 7px; bottom: 7px;
  font-weight: 800; letter-spacing: .02em; line-height: 1;
  pointer-events: none; user-select: none; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.75), 0 0 2px rgba(0,0,0,.5);
  z-index: 3;
}
/* album thumb and detail containers are already position:relative */
.album-thumb .wm { right: 7px; bottom: 7px; }
.detail-media { position: relative; }

/* ---- in-feed moderation (staff approve/reject on the main page) ---- */
.mod-actions { display: flex; gap: 8px; margin-top: 8px; }
.mod-actions .btn { font-size: 12.5px; padding: 5px 14px; }
.album-card .mod-actions { margin: 8px 11px 2px; }

/* ---- GIF picker ---- */
.gif-btn {
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px;
}
.gif-btn:hover { border-color: var(--accent); color: var(--accent-soft); }
.gif-modal { width: 480px; }
.gif-modal input { margin-top: 12px; }
.gif-results {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 12px; max-height: 46vh; overflow-y: auto;
}
.gif-results img {
  width: 100%; height: 110px; object-fit: cover; border-radius: 8px;
  cursor: pointer; border: 1px solid var(--border); background: #17181a;
}
.gif-results img:hover { border-color: var(--accent); }
.gif-empty { grid-column: 1 / -1; color: var(--text-dim); font-size: 13px; text-align: center; padding: 20px 0; }

/* ---- scrollbars ---- */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= ADMIN CONSOLE ================= */
.admin-wrap { height: 100%; overflow-y: auto; padding: 28px; max-width: 900px; margin: 0 auto; }
.admin-title { font-size: 24px; font-weight: 800; }
.admin-sub { color: var(--text-dim); font-size: 13px; margin: 4px 0 20px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px;
}
.stat-card .num { font-size: 24px; font-weight: 800; }
.stat-card .lbl { font-size: 12px; color: var(--text-dim); }
.stat-card.warn .num { color: var(--gold); }
.admin-section {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 18px;
}
.admin-section h2 { font-size: 16px; margin-bottom: 12px; }
.admin-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.admin-row input, .admin-row select { flex: 1; min-width: 120px; }
.admin-row .btn { white-space: nowrap; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .t-info { flex: 1; }
.toggle-row .t-name { font-weight: 600; font-size: 14px; }
.toggle-row .t-desc { font-size: 12px; color: var(--text-dim); }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer; transition: background .15s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-dim); top: 3px; left: 3px; transition: all .15s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { background: #fff; left: 21px; }
.wm-preview {
  position: relative; height: 120px; border-radius: 10px; margin: 4px 0 14px;
  background: repeating-linear-gradient(45deg, #2b2d31, #2b2d31 12px, #313338 12px, #313338 24px);
  border: 1px solid var(--border);
}
.wm-preview .wm {
  position: absolute; right: 10px; bottom: 8px; font-weight: 800; line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,.75), 0 0 2px rgba(0,0,0,.5); pointer-events: none;
}
.pend-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  margin-bottom: 10px; background: var(--bg);
}
.pend-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.pend-meta b { color: var(--text); }
.pend-text { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.pend-media { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pend-media img, .pend-media video { max-width: 140px; max-height: 100px; border-radius: 6px; border: 1px solid var(--border); }
.pend-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn.approve { background: #24332a; color: #7fce9d; }
.btn.approve:hover { background: #2c4034; }
.btn.reject { background: #3d2626; color: #e88f89; }
.btn.reject:hover { background: #4a2e2e; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-dim); padding: 6px 8px; border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 8px; border-bottom: 1px solid var(--border); }
.admin-table select { padding: 5px 8px; font-size: 13px; width: auto; }
.chan-item { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.chan-item .hash { color: var(--text-dim); font-weight: 800; }
.chan-item input { flex: 1; min-width: 100px; padding: 7px 10px; font-size: 13.5px; }
.empty-note { color: var(--text-dim); font-size: 13.5px; padding: 8px 0; }
.conn-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; }
.conn-dot.on { background: var(--ok); }

/* ============================================================
   MOBILE / RESPONSIVE  (phones and small tablets)
   ============================================================ */
@media (max-width: 820px) {
  /* show the mobile top bar */
  .mobile-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--sidebar);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30; flex-shrink: 0;
  }
  .mobile-bar .logo { flex: 1; font-size: 17px; }
  .mobile-btn { padding: 6px; color: var(--text); }

  /* stack the app vertically; main fills the screen */
  .app { flex-direction: column; }
  .main { flex: 1; min-height: 0; }

  /* sidebar slides in from the left as an overlay */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 82%; max-width: 300px;
    z-index: 60; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: 6px 0 24px rgba(0,0,0,.5);
  }
  .app.nav-open .sidebar { transform: translateX(0); }

  /* online list slides in from the right as an overlay */
  .online-bar {
    position: fixed; top: 0; right: 0; bottom: 0; width: 74%; max-width: 260px;
    z-index: 60; transform: translateX(100%);
    transition: transform .22s ease; box-shadow: -6px 0 24px rgba(0,0,0,.5);
    border-left: 1px solid var(--border);
  }
  .app.online-open .online-bar { transform: translateX(0); }

  /* dark backdrop when either panel is open */
  .nav-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55;
  }
  .app.nav-open .nav-backdrop,
  .app.online-open .nav-backdrop { display: block; }

  /* roomier tap targets + readable text in the feed */
  .feed { padding: 14px 12px; }
  .msg { padding: 9px 0; gap: 10px; }
  .msg-text { font-size: 15.5px; }
  .msg-media .media-item { max-width: 100%; }
  .msg-media img, .msg-media video { max-width: 100%; height: auto; max-height: 320px; }
  .msg-del, .msg-reply-btn { opacity: 1; } /* always tappable on touch */

  /* composer: bigger, thumb-friendly */
  .composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .composer textarea { font-size: 16px; } /* 16px stops iOS zoom-on-focus */
  .composer-row { gap: 7px; }
  .icon-btn.big { padding: 8px; }

  /* topic header wraps nicely; album controls become scrollable */
  .topic-head { padding: 11px 14px; }
  .album-bar {
    width: 100%; margin: 8px 0 0; flex-wrap: wrap; gap: 8px;
  }
  .album-bar .btn.primary { margin-left: auto; }

  /* album grid: two columns on phones */
  .album-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* modals fill more of the screen and never overflow */
  .modal { width: 94vw; max-height: 88vh; padding: 20px; }
  .detail-modal { width: 96vw; }
  .react-picker { max-width: 94vw; flex-wrap: wrap; }

  /* login / age cards fit small screens */
  .auth-card { padding: 24px 20px; }
}

/* very small phones */
@media (max-width: 380px) {
  .album-grid { grid-template-columns: 1fr; }
  .sidebar { width: 88%; }
}
