/* Forums (forums.html / forum.html / thread.html) — vBulletin-style boards */

.fr-page { max-width: 1080px; margin: 0 auto; padding: 24px 20px; }
.fr-page h1 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.fr-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; line-height: 1.6; }
.fr-crumbs { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--muted); }
.fr-crumbs a { font-weight: 700; }

.fr-section {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--bg2); margin-bottom: 22px;
}
.fr-band {
  background: linear-gradient(180deg, #2563eb, #1e40af); color: #fff;
  font-weight: 900; font-size: 15px; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.fr-band .fr-band-note { font-size: 12px; font-weight: 700; opacity: .85; }

.fr-cols {
  display: grid; grid-template-columns: 1fr 90px 90px 250px; gap: 12px;
  padding: 6px 16px; background: var(--bg3); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted);
}
.fr-cols span:nth-child(2), .fr-cols span:nth-child(3) { text-align: center; }

.fr-row {
  display: grid; grid-template-columns: 1fr 90px 90px 250px; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: center;
}
.fr-row:last-child { border-bottom: none; }
a.fr-row.fr-link-row { grid-template-columns: 1fr auto; text-decoration: none; color: inherit; }
a.fr-row.fr-link-row:hover { background: var(--bg3); }
.fr-visit { font-size: 12px; font-weight: 800; color: var(--blue); white-space: nowrap; }
.fr-row .fr-forum-name { font-size: 15px; font-weight: 800; }
.fr-row .fr-forum-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.fr-row .fr-num { text-align: center; font-size: 14px; font-weight: 800; }
.fr-row .fr-num .fr-num-label { display: none; }
.fr-last { font-size: 12px; line-height: 1.5; min-width: 0; }
.fr-last a { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-last .fr-last-meta { color: var(--muted); }
.fr-last-empty { font-size: 12px; color: var(--muted); }

/* Thread list rows (forum.html) */
.fr-trow {
  display: grid; grid-template-columns: 1fr 80px 80px 250px; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--border); align-items: center;
}
.fr-trow:last-child { border-bottom: none; }
.fr-tcols { grid-template-columns: 1fr 80px 80px 250px; }
.fr-tcols span:nth-child(2), .fr-tcols span:nth-child(3) { text-align: center; }
.fr-subband {
  padding: 6px 16px; background: var(--bg3); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted);
}
.fr-trow .fr-thread-title { font-size: 14px; font-weight: 800; }
.fr-trow .fr-thread-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.fr-tag {
  display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: .05em;
  text-transform: uppercase; border-radius: 6px; padding: 2px 7px; margin-right: 6px;
  position: relative; top: -1px;
}
.fr-tag.pin  { background: #14532d; color: #86efac; }
.fr-tag.lock { background: #450a0a; color: #fca5a5; }

/* Posts (thread.html) */
.fr-post {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--bg2); margin-bottom: 14px;
}
.fr-post.deleted { border-color: #7f1d1d; }
.fr-del-banner {
  background: #450a0a; color: #fca5a5; font-size: 12px; font-weight: 800;
  padding: 6px 14px; border-bottom: 1px solid #7f1d1d;
}
.fr-post-head {
  display: flex; justify-content: space-between; gap: 10px; padding: 7px 14px;
  background: var(--bg3); border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.fr-post-grid { display: grid; grid-template-columns: 190px 1fr; }
.fr-author {
  padding: 14px; border-right: 1px solid var(--border); font-size: 12px;
  line-height: 1.7; min-width: 0;
}
.fr-author .fr-author-name { font-size: 14px; font-weight: 800; display: block; }
.fr-author img.fr-avatar {
  width: 72px; height: 72px; object-fit: contain; border-radius: 8px;
  display: block; margin: 6px 0;
}
/* Staff avatars carry their rank accent (same palette as staff.html) */
.fr-avatar.administrator   { border: 2px solid #fca5a5; padding: 3px; }
.fr-avatar.super_moderator { border: 2px solid #a78bfa; padding: 3px; }
.fr-avatar.moderator       { border: 2px solid #60a5fa; padding: 3px; }
.fr-avatar.assistant       { border: 2px solid #fbbf24; padding: 3px; }
.fr-author .fr-author-meta { color: var(--muted); }
.fr-rank { font-weight: 800; }
.fr-rank.administrator   { color: #fca5a5; }
.fr-rank.super_moderator { color: #a78bfa; }
.fr-rank.moderator       { color: #60a5fa; }
.fr-rank.assistant       { color: #fbbf24; }
.fr-rank.trainer, .fr-rank.banned { color: var(--muted); }
.fr-rank.banned { text-decoration: line-through; opacity: .75; }
a.fr-author-name.fr-rank { font-size: 14px; }
.fr-body { padding: 14px 16px; font-size: 14px; line-height: 1.7; min-width: 0; word-break: break-word; }
.fr-quote {
  border-left: 3px solid var(--blue); background: var(--bg3);
  border-radius: 0 8px 8px 0; padding: 8px 12px; margin: 6px 0;
  font-size: 13px; color: var(--muted);
}
.fr-quote-who { font-weight: 800; margin-bottom: 4px; }
.fr-post-img { max-width: 100%; max-height: 400px; display: block; margin: 6px 0; border-radius: 8px; }
.fr-sig {
  border-top: 1px solid var(--border); margin-top: 14px; padding-top: 10px;
  font-size: 12.5px; color: var(--muted); line-height: 1.6; word-break: break-word;
}
.fr-sig .fr-post-img { max-height: 120px; display: inline-block; vertical-align: middle; margin: 2px 0; }
.fr-edited { font-size: 11px; color: var(--muted); font-style: italic; margin-top: 10px; }
.fr-post-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Post voting (staff attach the widget; everyone votes) */
.fr-vote { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.fr-vote-label {
  font-size: 11px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; margin-right: 2px;
}
.fr-vote-btn {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; font-size: 12px; font-weight: 800; padding: 4px 11px; cursor: pointer;
}
.fr-vote-btn:hover { border-color: var(--blue); }
.fr-vote-btn.mine { border-color: var(--blue); background: var(--bg2); color: var(--blue); }
.fr-vote-btn.up.mine { border-color: #16a34a; color: #4ade80; }
.fr-vote-btn.down.mine { border-color: #7f1d1d; color: #fca5a5; }
.fr-vote-count { font-size: 12px; color: var(--muted); font-weight: 700; }
.fr-vote-n { font-weight: 700; color: var(--muted); font-size: 11px; }
.fr-vote-btn.mine .fr-vote-n { color: inherit; }
.fr-vote-who { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.fr-vote-who b { color: var(--text); }

.fr-btn-sm {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; font-size: 12px; font-weight: 800; padding: 5px 12px; cursor: pointer;
}
.fr-btn-sm:hover { border-color: var(--blue); }
.fr-btn-sm.danger { border-color: #7f1d1d; color: #fca5a5; }
.fr-btn-sm.danger:hover { background: #450a0a; }

/* Composer (new thread / reply / edit) */
.fr-composer {
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg2);
  padding: 16px; margin-bottom: 22px;
}
.fr-composer h3 { margin: 0 0 10px; font-size: 15px; font-weight: 900; }
.fr-composer input, .fr-composer textarea {
  width: 100%; box-sizing: border-box; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  padding: 9px 12px; font-size: 14px; font-family: inherit; margin-bottom: 10px;
}
.fr-composer textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
.fr-composer .fr-composer-hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.fr-composer .fr-field-label { font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.fr-msg { font-size: 13px; color: #fca5a5; min-height: 18px; margin-top: 8px; }

/* Formatting toolbar */
.fr-tb { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.fr-tb-btn {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; font-size: 13px; font-weight: 700; padding: 5px 11px;
  cursor: pointer; min-width: 34px;
}
.fr-tb-btn:hover { border-color: var(--blue); }
.fr-tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* Preview box */
.fr-preview {
  border: 1px dashed var(--border); border-radius: 10px; background: var(--bg3);
  padding: 12px 14px; margin-top: 12px; font-size: 14px; line-height: 1.7;
}
.fr-preview-label {
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}

.fr-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.fr-toolbar .fr-spacer { flex: 1; }

.fr-pages { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.fr-pages a, .fr-pages span {
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 11px;
  font-size: 13px; font-weight: 800; text-decoration: none;
}
.fr-pages span.cur { background: var(--blue); border-color: var(--blue); color: #fff; }

.fr-who { padding: 14px 16px; font-size: 13px; line-height: 1.9; }
.fr-who a { font-weight: 800; text-decoration: none; }
.fr-who a.trainer { color: var(--text); }
.fr-who-legend {
  padding: 0 16px 12px; font-size: 12px; color: var(--muted);
  display: flex; gap: 14px; flex-wrap: wrap;
}
.fr-stats {
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg2);
  padding: 12px 16px; font-size: 13px; color: var(--muted);
}
.fr-stats b { color: var(--text); }

.fr-empty { padding: 20px 16px; font-size: 13px; color: var(--muted); text-align: center; }
.fr-locked-note {
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg2);
  padding: 14px 16px; font-size: 13px; color: var(--muted);
}
#fr-lock { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 14px; line-height: 1.8; }

/* Report-post overlay (in-page, never window.confirm) */
.fr-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 400;
  align-items: flex-start; justify-content: center; padding: 60px 16px;
}
.fr-overlay.show { display: flex; }
.fr-dialog {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; width: 100%; max-width: 540px; max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.fr-dialog h3 { margin: 0 0 10px; font-size: 16px; font-weight: 900; }
.fr-dialog .fr-dialog-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.fr-report-quote { max-height: 220px; overflow-y: auto; margin-bottom: 12px; }
.fr-dialog textarea {
  width: 100%; box-sizing: border-box; background: var(--bg3);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  padding: 9px 12px; font-size: 14px; font-family: inherit; min-height: 110px;
  resize: vertical; line-height: 1.6; margin-bottom: 10px;
}

@media (max-width: 760px) {
  .fr-cols, .fr-tcols { display: none; }
  .fr-row, .fr-trow { grid-template-columns: 1fr; gap: 6px; }
  .fr-row .fr-num { text-align: left; font-size: 12px; }
  .fr-row .fr-num .fr-num-label { display: inline; color: var(--muted); font-weight: 700; }
  .fr-post-grid { grid-template-columns: 1fr; }
  .fr-author { border-right: none; border-bottom: 1px solid var(--border); }
}
