/* ── forum layout ── */
.forum-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
  overflow: hidden;
  background: #0f0f1c;
}

/* ── sidebar ── */
.forum-sidebar {
  border-right: 1px solid rgba(255,255,255,0.07);
  padding: 28px 0 28px;
  height: 100%;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(224,40,40,0.045) 0%, #12121e 100%);
  display: flex;
  flex-direction: column;
}

.forum-sidebar::-webkit-scrollbar { width: 3px; }
.forum-sidebar::-webkit-scrollbar-track { background: transparent; }
.forum-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.forum-sidebar-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 22px 18px;
}

.forum-sidebar-section-label {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 22px 10px;
}

.forum-sidebar-section-divider {
  height: 1px;
  background: rgba(224,40,40,0.1);
  margin: 12px 14px 16px;
}

.forum-sidebar-channels {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.forum-channel-link {
  display: flex;
  align-items: center;
  padding: 15px 16px;
  color: rgba(255,255,255,0.55);
  border-left: 3px solid transparent;
  border-radius: 0 12px 12px 0;
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
  text-decoration: none;
}

.forum-channel-link-inner { width: 100%; min-width: 0; }

.forum-channel-link-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.forum-channel-hash {
  color: rgba(224,40,40,0.5);
  font-weight: 800;
  font-size: 0.9em;
  margin-right: 1px;
  transition: color 0.18s;
}
.forum-channel-link.active .forum-channel-hash,
.forum-channel-link:hover .forum-channel-hash { color: rgba(224,40,40,0.85); }

.forum-channel-link-name {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forum-channel-link-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224,40,40,0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(224,40,40,0); }
}
.forum-channel-live {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(224,40,40,0.2);
  border: 1px solid rgba(224,40,40,0.4);
  color: #e05050;
  flex-shrink: 0;
  animation: live-pulse 2s ease-in-out infinite;
}

.forum-channel-link:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.06);
  transform: translateX(4px);
}

.forum-channel-link.active {
  color: #fff;
  border-left-color: rgba(224,40,40,0.9);
  background: rgba(224,40,40,0.12);
  box-shadow: inset 0 0 24px rgba(224,40,40,0.06), 0 2px 10px rgba(0,0,0,0.2);
}

.forum-channel-link.active .forum-channel-link-name {
  text-shadow: 0 0 18px rgba(224,40,40,0.55);
  font-weight: 700;
}

.forum-channel-link.active .forum-channel-live {
  background: rgba(224,40,40,0.3);
  color: #ff6060;
}

/* ── main ── */
.forum-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  height: 100%;
  background: #0d0d18;
}

.forum-channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(224,40,40,0.05) 0%, transparent 100%);
}

.forum-channel-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #b0a8c8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(224,40,40,0.22));
}

.forum-channel-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

/* ── chat mode ── */
#forumBody {
  min-height: 0;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.forum-chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.forum-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
  min-height: 0;
}

.forum-chat-messages::-webkit-scrollbar { width: 4px; }
.forum-chat-messages::-webkit-scrollbar-track { background: transparent; }
.forum-chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.forum-msg {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 10px;
  transition: background 0.12s, box-shadow 0.12s;
  position: relative;
}

.forum-msg:hover {
  background: rgba(255,255,255,0.035);
  box-shadow: inset 3px 0 0 rgba(224,40,40,0.22);
  border-radius: 0 10px 10px 0;
}

.forum-msg-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  margin-top: 1px;
  flex-shrink: 0;
  transition: box-shadow 0.18s, transform 0.18s;
  cursor: pointer;
}

.forum-msg-avatar:hover {
  box-shadow: 0 0 0 2px rgba(224,40,40,0.7), 0 0 20px rgba(224,40,40,0.35);
  transform: scale(1.06);
}

.forum-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.02em;
  flex-shrink: 0;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  margin-top: 1px;
  background: var(--av-bg, #7a1515);
  transition: box-shadow 0.18s, transform 0.18s;
  cursor: pointer;
}

.forum-avatar-initial:hover {
  box-shadow: 0 0 0 2px rgba(224,40,40,0.7), 0 0 20px rgba(224,40,40,0.35);
  transform: scale(1.06);
}

.forum-msg-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 3px;
}

.forum-msg-username {
  font-size: 1rem;
  font-weight: 700;
  color: #f0f2ff;
  letter-spacing: 0.01em;
}

.forum-msg-username.is-mod {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(224,40,40,0.55);
}

.forum-msg-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.forum-msg-body {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #dde0f2;
  word-break: break-word;
  white-space: pre-wrap;
}

.forum-msg-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  align-self: start;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.forum-msg-delete:hover { color: #e05c5c; background: rgba(224,92,92,0.1); }

/* username profile link */
.forum-msg-name-link {
  text-decoration: none;
  transition: text-shadow 0.15s, color 0.15s;
  cursor: pointer;
}

.forum-msg-name-link:hover {
  color: var(--gold);
  text-shadow: 0 0 16px rgba(224,40,40,0.8);
}

/* system / arena messages */
.forum-msg--system {
  background: rgba(224,40,40,0.05);
  border: 1px solid rgba(224,40,40,0.14);
  border-radius: 10px;
  margin: 8px 0;
}

.forum-msg--system:hover {
  background: rgba(224,40,40,0.08);
}

.forum-msg-avatar--system {
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(224,40,40,0.4));
}

.forum-msg-username--system {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.forum-msg-body--system {
  color: #d4d6e0;
  font-size: 0.92rem;
}

/* grouped messages */
.forum-msg--grouped {
  padding-top: 1px;
  padding-bottom: 1px;
}

.forum-msg-grouped-ts {
  font-size: 0.62rem;
  color: transparent;
  text-align: right;
  padding-top: 5px;
  transition: color 0.1s;
  user-select: none;
  line-height: 1.6;
}

.forum-msg--grouped:hover .forum-msg-grouped-ts {
  color: var(--text-muted);
}

.forum-msg-grouped-content {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.forum-msg-grouped-content .forum-msg-body {
  flex: 1;
}

/* ── message actions (reply + delete) ── */
.forum-msg-actions {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.forum-msg:hover .forum-msg-actions,
.forum-msg--grouped:hover .forum-msg-actions { display: flex; }

.forum-msg-reply-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.forum-msg-reply-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }

/* ── reply quote ── */
.forum-msg-reply-quote {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 12px;
  margin-bottom: 6px;
  border-left: 3px solid rgba(224,40,40,0.4);
  border-radius: 0 6px 6px 0;
  background: rgba(224,40,40,0.04);
  cursor: pointer;
  max-width: 520px;
  transition: background 0.15s;
}
.forum-msg-reply-quote:hover { background: rgba(224,40,40,0.08); }
.forum-msg-reply-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}
.forum-msg-reply-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── reply indicator above input ── */
.forum-reply-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 16px;
  margin-bottom: 8px;
  background: rgba(224,40,40,0.06);
  border: 1px solid rgba(224,40,40,0.2);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.forum-reply-indicator button {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1rem; flex-shrink: 0;
  transition: color 0.15s;
}
.forum-reply-indicator button:hover { color: var(--text); }

/* ── image preview above input ── */
.forum-image-preview-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 6px;
}
.forum-image-preview {
  max-height: 120px;
  max-width: 220px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.forum-image-preview-remove {
  background: rgba(0,0,0,0.6); border: none;
  color: #fff; border-radius: 50%;
  width: 24px; height: 24px;
  font-size: 0.72rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── image in messages ── */
.forum-msg-img-wrap { margin-top: 8px; }
.forum-msg-img {
  max-width: 360px;
  max-height: 300px;
  border-radius: 10px;
  object-fit: cover;
  cursor: zoom-in;
  border: 1px solid var(--border);
  transition: opacity 0.15s, transform 0.18s;
  display: block;
}
.forum-msg-img:hover { opacity: 0.92; transform: scale(1.01); }

/* ── lightbox ── */
.forum-img-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.forum-img-lightbox img {
  max-width: 92vw; max-height: 92vh;
  border-radius: 10px; object-fit: contain;
}
.forum-img-lightbox button {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,0.12); border: none;
  color: #fff; width: 40px; height: 40px;
  border-radius: 50%; font-size: 1.1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.forum-img-lightbox button:hover { background: rgba(255,255,255,0.22); }

/* ── attach + emoji buttons ── */
.forum-attach-btn,
.forum-emoji-btn {
  background: none; border: none;
  font-size: 1.1rem; cursor: pointer;
  padding: 0 5px; flex-shrink: 0;
  opacity: 0.55; transition: opacity 0.15s, transform 0.15s;
}
.forum-attach-btn:hover,
.forum-emoji-btn:hover { opacity: 1; transform: scale(1.15); }

/* ── emoji picker ── */
.forum-emoji-picker {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  display: grid;
  grid-template-columns: repeat(10, 36px);
  gap: 3px;
  padding: 12px;
  background: var(--bg2);
  border: 1px solid rgba(224,40,40,0.18);
  border-radius: 14px;
  box-shadow: 0 -6px 28px rgba(0,0,0,0.55);
  z-index: 50;
}

.forum-emoji-item {
  background: none; border: none;
  font-size: 1.2rem; cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
  line-height: 1;
}
.forum-emoji-item:hover { background: rgba(255,255,255,0.1); transform: scale(1.2); }

/* ── message highlight (scroll-to) ── */
.forum-msg--highlight { background: rgba(224,40,40,0.1) !important; transition: background 0.8s; }

/* new message slide-in */
@keyframes forum-msg-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.forum-msg--new { animation: forum-msg-in 0.28s cubic-bezier(0.34,1.56,0.64,1) both; }

/* chat input */
.forum-chat-input-wrap {
  padding: 14px 40px 24px;
  flex-shrink: 0;
}

.forum-chat-input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: #181828;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 13px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.forum-chat-input-row:focus-within {
  border-color: rgba(224,40,40,0.4);
  box-shadow: 0 0 0 3px rgba(224,40,40,0.06), 0 0 28px rgba(224,40,40,0.07);
}

.forum-chat-textarea {
  flex: 1;
  background: none;
  border: none;
  color: #f0f2ff;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.55;
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 130px;
  overflow-y: auto;
}

.forum-chat-textarea::placeholder { color: var(--text-muted); }

.forum-chat-send {
  background: linear-gradient(135deg, rgba(224,40,40,0.9), rgba(255,60,60,0.95));
  border: none;
  border-radius: 10px;
  padding: 9px 20px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.18s;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(224,40,40,0.25);
}

.forum-chat-send:hover {
  opacity: 0.9; transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 22px rgba(224,40,40,0.35);
}
.forum-chat-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

.forum-chat-locked {
  text-decoration: none;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.forum-chat-locked:hover { opacity: 1; border-color: rgba(224,40,40,0.35) !important; }

.forum-chat-locked-text {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* ── date dividers ── */
.forum-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 10px;
  color: rgba(224,40,40,0.55);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  user-select: none;
}

.forum-date-divider::before,
.forum-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224,40,40,0.2), transparent);
}

/* ── empty state ── */
.forum-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}

.forum-empty-icon {
  font-size: 2.4rem; margin-bottom: 16px;
  display: block; opacity: 0.55;
  filter: drop-shadow(0 0 12px rgba(224,40,40,0.3));
}

.forum-empty-title {
  font-size: 1.1rem; font-weight: 700;
  margin-bottom: 8px; color: var(--text);
}
.forum-empty-sub   { font-size: 0.9rem; color: var(--text-muted); }

/* ── thread list mode ── */
.forum-threads-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 36px 40px;
}

.forum-thread-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forum-thread-row {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border-radius: 14px;
  background: #141420;
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 3px solid rgba(224,40,40,0.2);
  cursor: pointer;
  position: relative; overflow: hidden;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.25s, transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.forum-thread-row::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.024) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform 0.6s ease;
}
.forum-thread-row:hover::after { transform: translateX(130%); }

.forum-thread-row:hover {
  border-color: rgba(224,40,40,0.4);
  background: rgba(224,40,40,0.03);
  box-shadow: 0 8px 30px rgba(224,40,40,0.1), 0 2px 8px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

.forum-thread-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
}

.forum-thread-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f0f2ff;
  margin-bottom: 4px;
}

.forum-thread-excerpt {
  font-size: 0.93rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forum-thread-byline {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.forum-thread-meta {
  text-align: right;
  flex-shrink: 0;
  padding-left: 8px;
}

.forum-thread-reply-count {
  font-size: 0.78rem; font-weight: 700;
  color: var(--gold);
  background: rgba(224,40,40,0.11);
  border: 1px solid rgba(224,40,40,0.22);
  border-radius: 20px;
  padding: 3px 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.18s, box-shadow 0.18s;
}
.forum-thread-row:hover .forum-thread-reply-count {
  background: rgba(224,40,40,0.18);
  box-shadow: 0 0 10px rgba(224,40,40,0.18);
}
.forum-thread-last-reply { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

/* ── thread view ── */
.forum-thread-page-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
}

.forum-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.forum-breadcrumb a { color: var(--text-dim); transition: color 0.15s; }
.forum-breadcrumb a:hover { color: var(--gold); }

.forum-thread-title-full {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(224,40,40,0.12);
  background: linear-gradient(135deg, #ffffff 40%, #9a8fa0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(224,40,40,0.15));
}

.forum-post-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }

.forum-post {
  background: #141420;
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 3px solid rgba(224,40,40,0.2);
  border-radius: 14px;
  padding: 26px 30px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.forum-post.op {
  border-left-color: rgba(224,40,40,0.55);
  background: linear-gradient(160deg, rgba(224,40,40,0.03) 0%, var(--surface) 50%);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.forum-post-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.forum-post-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  border: 2px solid rgba(224,40,40,0.2);
}

.forum-post.op .forum-post-avatar {
  border-color: rgba(224,40,40,0.45);
  box-shadow: 0 0 14px rgba(224,40,40,0.18);
}

.forum-post-meta   { flex: 1; min-width: 0; }
.forum-post-username { font-weight: 700; font-size: 0.95rem; }

.forum-post-class {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(224,40,40,0.4);
  margin-top: 3px;
}

.forum-post-time { font-size: 0.76rem; color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.forum-post-body { font-size: 1.05rem; line-height: 1.85; color: #dde0f2; white-space: pre-wrap; word-break: break-word; }

/* reply form */
.forum-reply-form {
  background: var(--surface);
  border: 1px solid rgba(224,40,40,0.18);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.forum-reply-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.forum-reply-textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.97rem;
  line-height: 1.7;
  resize: vertical;
  min-height: 110px;
  display: block;
  margin-bottom: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.forum-reply-textarea:focus {
  outline: none;
  border-color: rgba(224,40,40,0.35);
  box-shadow: 0 0 0 3px rgba(224,40,40,0.06);
}

/* new thread modal */
.forum-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.forum-modal-overlay.hidden { display: none; }

.forum-modal {
  background: var(--surface);
  border: 1px solid rgba(224,40,40,0.22);
  border-radius: 18px;
  padding: 32px;
  width: 100%;
  max-width: 580px;
  box-shadow: 0 0 80px rgba(224,40,40,0.1), 0 20px 60px rgba(0,0,0,0.6);
  position: relative; overflow: hidden;
}
.forum-modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(224,40,40,0.6), transparent);
}

.forum-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 22px;
  background: linear-gradient(135deg, #fff 40%, #9a8fa0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.forum-input, .forum-textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.97rem;
  display: block;
  margin-bottom: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.forum-input:focus, .forum-textarea:focus {
  outline: none;
  border-color: rgba(224,40,40,0.4);
  box-shadow: 0 0 0 3px rgba(224,40,40,0.07);
}

.forum-textarea { resize: vertical; min-height: 160px; line-height: 1.7; margin-bottom: 18px; }
.forum-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* login prompt */
.forum-login-prompt {
  background: var(--surface); border: 1px solid rgba(224,40,40,0.18);
  border-radius: var(--radius); padding: 32px; text-align: center;
}
.forum-login-prompt p { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 16px; }

/* ── responsive ── */
@media (max-width: 768px) {
  /* Hide footer — forum fills the full screen, no page scroll */
  .footer { display: none !important; }

  /* Full-height viewport layout, no page scroll */
  .forum-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    width: 100%;
    max-width: 100vw;
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    overflow: hidden;
  }

  /* Compact channel pill row */
  .forum-sidebar {
    width: 100%;
    max-width: 100vw;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 10px 0;
    background: #12121e;
    overflow: hidden;
  }

  .forum-sidebar-label,
  .forum-sidebar-section-label,
  .forum-sidebar-section-divider { display: none; }

  .forum-sidebar-channels {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 14px;
    gap: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .forum-sidebar-channels::-webkit-scrollbar { display: none; }

  .forum-channel-link {
    border-left: none !important;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 8px 16px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.03);
    transform: none !important;
  }
  .forum-channel-link:hover { transform: none !important; background: rgba(255,255,255,0.07); }

  .forum-channel-link.active {
    background: rgba(224,40,40,0.15);
    border-color: rgba(224,40,40,0.4) !important;
  }
  .forum-channel-link.active .forum-channel-link-name { text-shadow: none; }
  .forum-channel-link-desc { display: none; }

  /* Main content fills grid row */
  .forum-main {
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .forum-channel-header { padding: 14px 18px; max-width: 100%; overflow: hidden; }
  .forum-channel-title { font-size: 1.3rem; }
  .forum-channel-desc { font-size: 0.82rem; }

  .forum-chat-messages,
  .forum-threads-wrap { padding: 12px 14px; max-width: 100%; }

  .forum-chat-input-wrap { padding: 8px 14px 14px; max-width: 100%; }
  .forum-thread-page-wrap { padding: 16px 14px; max-width: 100%; overflow-x: hidden; }

  /* Smaller avatars */
  .forum-msg { grid-template-columns: 40px 1fr; gap: 10px; padding: 7px 8px; }
  .forum-msg-avatar, .forum-avatar-initial { width: 40px; height: 40px; }
  .forum-msg-body { font-size: 0.97rem; }
  .forum-msg-username { font-size: 0.95rem; }

  .forum-thread-row { grid-template-columns: 40px 1fr; gap: 12px; padding: 14px 16px; }
  .forum-thread-meta { display: none; }
  .forum-thread-avatar { width: 40px; height: 40px; }
  .forum-thread-title { font-size: 1.05rem; }

  .forum-post { padding: 18px 16px; }
  .forum-post-avatar { width: 40px; height: 40px; }
  .forum-post-body { font-size: 0.97rem; }

  /* emoji picker: narrower so it fits on screen */
  .forum-emoji-picker { grid-template-columns: repeat(8, 34px); right: 0; left: auto; }

  /* images: never exceed the message column width */
  .forum-msg-img { max-width: 100%; }

  /* reply quotes: cap at screen width */
  .forum-msg-reply-quote { max-width: 100%; }
}
