/* Forum styles. Builds on the tokens and components in styles.css. */

.nav a.active { color: var(--bone); }
.userbar { display: flex; align-items: center; gap: 10px; margin-left: 12px; }
.userbar .me { display: flex; align-items: center; gap: 8px; color: var(--bone); text-decoration: none; font-family: var(--font-label); font-weight: 600; letter-spacing: .5px; }
.userbar .me .avatar { width: 30px; height: 30px; font-size: 16px; }
.modlink {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 14px;
  color: var(--gold); text-decoration: none;
}
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--red); color: #fff; font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0;
}

.forum { max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 64px; min-height: 60vh; outline: none; }
.forum > * { max-width: none; }
/* styles.css pads and centers every <section> for the landing page; undo that inside the forum. */
.forum section { padding: 0; }
.forum section > * { max-width: none; margin-left: 0; margin-right: 0; }
.forum .panel { padding: 22px; }
.forum .panel.center { padding: 48px 22px; }
.loading { color: var(--muted); font-family: var(--font-crt); font-size: 22px; }
.forum h1 { font-family: var(--font-display); font-size: clamp(40px, 6vw, 60px); line-height: .95; color: var(--bone); letter-spacing: 1px; font-weight: 400; margin: 0; }
.forum h2 { font-size: clamp(24px, 3vw, 30px); }
.forum h3 { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--bone); margin: 22px 0 10px; }
.small { font-size: 13px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; }

.panel { padding: 22px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 16px; }
.panel h2 { font-size: 28px; margin-bottom: 12px; }
.panel.center { text-align: center; padding: 48px 22px; }
.stack { display: grid; gap: 14px; }

/* notices & toasts */
.notices { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.notices:empty { display: none; }
.notice { margin-top: 16px; padding: 12px 16px; border-radius: 8px; border: 1px solid; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notice-red { border-color: var(--red); background: rgba(210, 56, 47, .12); color: var(--bone); }
.notice-gold { border-color: var(--gold); background: rgba(201, 162, 74, .1); color: var(--bone); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  padding: 12px 16px; border-radius: 8px; background: #23301a; border: 1px solid var(--lime-deep); color: var(--bone);
  box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: opacity .5s, transform .5s;
}
.toast-error { background: #3a1513; border-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* breadcrumbs, headers, tags */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; font-family: var(--font-label); font-weight: 600; letter-spacing: .5px; font-size: 15px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--bone); }
.crumbs span:last-child { color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.crumbs .sep { color: var(--line); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head .sub { margin: 8px 0 0; }
.thread-head h1 { font-size: clamp(32px, 5vw, 48px); overflow-wrap: anywhere; }
.tag {
  display: inline-block; margin: 0 6px 0 0; padding: 1px 8px; border-radius: 3px; vertical-align: 2px;
  font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 12px;
  background: rgba(255,255,255,.08); color: var(--bone);
}
.tag-red, .tag-ban, .tag-purge { background: rgba(210, 56, 47, .2); color: #ff8a80; }
.tag-warn { background: rgba(201, 162, 74, .2); color: var(--gold); }
.tag-unban, .tag-role { background: rgba(156, 196, 43, .15); color: var(--lime); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 3px; vertical-align: middle;
  font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 12px;
}
.badge-admin { background: var(--red); color: #fff; }
.badge-mod { background: var(--purple-deep); color: #fff; }
.badge-banned { background: #3a1513; color: #ff8a80; border: 1px solid var(--red); }
/* custom role badges */
.badge-role { border: 1px solid currentColor; background: transparent; }
.role-red { color: #ff8a80; } .role-orange { color: #ffb366; } .role-gold { color: var(--gold); }
.role-lime { color: var(--lime); } .role-teal { color: #5fd3c6; } .role-blue { color: #7ea8ff; }
.role-purple { color: #c9a4ff; } .role-pink { color: #ff8fd0; } .role-gray { color: #b5ab98; }
.post-author .badge, .profile-head .badge { margin: 1px 2px; }

/* modal checkbox groups */
.checks { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 12px; margin: 0; }
.checks legend { padding: 0 6px; font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 14px; color: var(--muted); }
.checks .hint { margin: 0 0 4px; }
.modal { max-height: calc(100vh - 32px); }
.modal-form .hint { margin: 0; font-size: 13px; color: var(--muted); }
.modal input[type=date] { color-scheme: dark; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { margin-left: 6px; }
.notice-list { display: grid; gap: 12px; }
.notice-admin h3 { margin: 0; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 20px; }
.notice-admin .post-body { margin: 10px 0 14px; }
.notice-admin.is-deleted { opacity: .55; }

.badge-muted { background: #33290f; color: var(--gold); border: 1px solid var(--gold); }
.btn-gold { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-gold:hover { background: rgba(201,162,74,.12); }
.tag-mute { background: rgba(201, 162, 74, .2); color: var(--gold); }
.tag-unmute { background: rgba(156, 196, 43, .15); color: var(--lime); }
.avatar {
  --hue: 82;
  display: inline-grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%;
  background: hsl(var(--hue) 45% 28%); color: hsl(var(--hue) 70% 85%);
  font-family: var(--font-display); font-size: 28px; line-height: 1; border: 2px solid hsl(var(--hue) 45% 40%);
}
.uname { color: var(--bone); font-weight: 600; text-decoration: none; }
.uname:hover { text-decoration: underline; }
.uname-admin { color: #ff8a80; }
.uname-mod { color: #c9a4ff; }

/* home */
.forum-hero { padding: 8px 0 26px; }
.forum-hero h1 { font-size: clamp(56px, 9vw, 96px); }
.forum-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.cat-list { display: grid; gap: 10px; }
.cat-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px 220px; gap: 16px; align-items: center;
  padding: 18px 20px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--purple);
  color: var(--text); text-decoration: none; transition: border-color .12s, transform .12s;
}
.cat-row:nth-child(6n+2) { border-left-color: var(--lime); }
.cat-row:nth-child(6n+3) { border-left-color: var(--red); }
.cat-row:nth-child(6n+4) { border-left-color: var(--gold); }
.cat-row:nth-child(6n+5) { border-left-color: #5865f2; }
.cat-row:hover { border-color: var(--bone); transform: translateY(-1px); }
.cat-main h2 { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 21px; color: var(--bone); line-height: 1.15; margin: 0; }
.cat-main h2 .tag { margin-left: 8px; }
.cat-main p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.cat-stats { display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.cat-stats b { color: var(--bone); font-variant-numeric: tabular-nums; }
.cat-last { display: grid; gap: 2px; font-size: 14px; min-width: 0; }
.cl-title { color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-by { color: var(--muted); }
.recent { padding: 20px; border-radius: 10px; background: #070a06; border: 1px solid #1e3a1a; }
.recent h2 { font-family: var(--font-crt); font-size: 26px; color: var(--crt); text-shadow: 0 0 8px rgba(125,255,106,.45); margin-bottom: 10px; }
.recent ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.recent li { display: grid; gap: 2px; font-size: 15px; }
.recent a { color: var(--bone); text-decoration: none; overflow-wrap: anywhere; }
.recent a:hover { color: var(--lime); }
.recent .dim { font-size: 13px; }

/* thread list */
.thread-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.thread-list .empty { border: 0; }
.thread-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 90px 170px; gap: 16px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: rgba(255,255,255,.02); }
.thread-row.is-deleted { opacity: .55; }
.tr-main { display: grid; gap: 2px; min-width: 0; }
.tr-title { color: var(--bone); font-weight: 600; font-size: 17px; text-decoration: none; overflow-wrap: anywhere; }
.tr-title:hover { color: var(--lime); }
.tr-meta { font-size: 13px; color: var(--muted); }
.tr-meta .tag { margin-left: 8px; }
.tr-count { display: grid; text-align: center; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-label); }
.tr-count b { font-family: var(--font-body); font-size: 18px; color: var(--bone); letter-spacing: 0; }
.tr-last { display: grid; font-size: 14px; color: var(--bone); text-decoration: none; text-align: right; }
.tr-last .dim { font-size: 13px; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.pg {
  display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--bone); text-decoration: none; font-family: var(--font-label); font-weight: 600;
}
.pg:hover { border-color: var(--bone); }
.pg-on { background: var(--purple); border-color: var(--purple); color: #fff; }
.pg-gap { align-self: center; color: var(--muted); }

/* thread view */
.modbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px;
  padding: 10px 12px; border-radius: 8px; border: 1px dashed var(--gold); background: rgba(201,162,74,.06);
}
.modbar-label { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); margin-right: 4px; }
.posts { display: grid; gap: 14px; }
.post { display: grid; grid-template-columns: 170px minmax(0, 1fr); border-radius: 10px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.post.is-deleted { border-style: dashed; opacity: .7; }
.post-author {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 18px 12px; background: rgba(0,0,0,.2); border-right: 1px solid var(--line);
}
.pa-name { font-size: 16px; overflow-wrap: anywhere; }
.pa-meta { font-size: 12px; color: var(--muted); }
.post-main { display: flex; flex-direction: column; min-width: 0; padding: 14px 20px; }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.edited { font-style: italic; }
.post-body { line-height: 1.65; overflow-wrap: anywhere; color: var(--text); }
.post-body blockquote {
  margin: 8px 0; padding: 8px 14px; border-left: 3px solid var(--purple); background: rgba(155,77,255,.07); color: var(--muted); border-radius: 0 6px 6px 0;
}
.post-body code { font-family: var(--font-crt); font-size: 1.15em; background: #070a06; color: var(--crt); padding: 0 5px; border-radius: 3px; }
.post-body pre { background: #070a06; border: 1px solid #1e3a1a; border-radius: 6px; padding: 12px; overflow-x: auto; }
.post-body pre code { background: none; padding: 0; }
.post-body a { color: var(--lime); }
.spoiler { background: #000; color: transparent; border-radius: 3px; padding: 0 4px; cursor: pointer; transition: color .15s; user-select: none; }
.spoiler.revealed { color: var(--bone); background: rgba(255,255,255,.08); user-select: text; cursor: auto; }
.removed { color: var(--muted); font-style: italic; margin: 0; }
.post-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: auto; padding-top: 14px; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.link:hover { color: var(--bone); }
.link-dim { margin-left: auto; }
.link-dim:hover { color: #ff8a80; }
.reply-form { margin-top: 20px; }
.reply-cta { margin-top: 20px; text-align: center; }
.edit-form { display: grid; gap: 12px; }

/* forms */
.field { display: grid; gap: 6px; }
.field > span { font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 14px; color: var(--muted); }
.forum input[type=text], .forum input[type=email], .forum input[type=password], .forum input[type=search], .forum input[type=number],
.forum textarea, .forum select, .modal input, .modal textarea, .modal select {
  width: 100%; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); background: #0b0908; color: var(--bone);
  font: inherit; font-size: 16px;
}
.forum textarea, .modal textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.forum input:focus, .forum textarea:focus, .forum select:focus, .modal input:focus, .modal textarea:focus, .modal select:focus {
  outline: 2px solid var(--purple); outline-offset: 0; border-color: var(--purple);
}
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--lime); }
.hint { margin: -8px 0 0; font-size: 13px; color: var(--muted); }
.format-help { margin: 0; font-family: var(--font-crt); font-size: 16px; color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.form-msg:empty { display: none; }
.form-msg { display: grid; gap: 8px; justify-items: start; }
.error { margin: 0; color: #ff8a80; }
.btn-wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* auth */
.auth { display: grid; place-items: center; padding: 20px 0; }
.forum .auth-card {
  margin: 0 auto;
  width: min(440px, 100%); padding: 32px 28px; border-radius: 12px; text-align: center;
  background: radial-gradient(400px 200px at 50% 0%, rgba(155,77,255,.18), transparent 70%), var(--panel); border: 1px solid var(--purple-deep);
}
.auth-card form { text-align: left; margin-top: 18px; }
.auth-card .sub { margin: 8px auto 0; }
.auth-avatar { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px; border: 3px solid var(--red); background: #fff; }
.auth-foot { display: grid; gap: 8px; margin-top: 18px; font-size: 15px; color: var(--muted); }

/* profile & account */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.profile-head .avatar { width: 84px; height: 84px; font-size: 46px; }
.profile-head h1 .badge { font-family: var(--font-label); font-size: 14px; vertical-align: 10px; }
.profile-head .sub { margin: 6px 0 0; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0 0 14px; }
.facts dt { color: var(--muted); font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 14px; }
.facts dd { margin: 0; color: var(--bone); overflow-wrap: anywhere; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.activity a { color: var(--bone); font-weight: 600; }
.activity p { margin: 4px 0 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.mod-panel { border-color: var(--gold); border-style: dashed; background: rgba(201,162,74,.05); }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.note-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; margin-bottom: 12px; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }

/* mod dashboard */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; margin-bottom: -1px;
  font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); text-decoration: none;
  border-bottom: 3px solid transparent;
}
.tab:hover { color: var(--bone); }
.tab-on { color: var(--bone); border-bottom-color: var(--gold); }
.subtabs { display: flex; gap: 14px; margin-bottom: 14px; }
.subtabs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.subtabs a.on { color: var(--lime); }
.report-list { display: grid; gap: 12px; }
.report { padding: 16px 18px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--red); }
.report a { color: var(--bone); }
.report-reason { margin: 8px 0; color: var(--bone); font-style: italic; }
.report-excerpt { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--line); color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.data { width: 100%; border-collapse: collapse; font-size: 15px; }
.data th { text-align: left; padding: 10px 14px; font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data td.detail { color: var(--muted); max-width: 420px; overflow-wrap: anywhere; }
.data a { color: var(--bone); }
.data code { font-family: var(--font-crt); font-size: 17px; color: var(--crt); white-space: nowrap; }
.cat-edit { display: grid; grid-template-columns: 200px minmax(0, 1fr) 80px auto auto; gap: 12px; align-items: end; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.cat-edit:last-child { border-bottom: 0; padding-bottom: 0; }
.cat-edit .check { padding-bottom: 10px; white-space: nowrap; }

/* modal */
.modal {
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.7);
}
.modal::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(2px); }
.modal-form { display: grid; gap: 14px; padding: 24px; }
.modal-form h2 { font-family: var(--font-display); font-weight: 400; font-size: 34px; color: var(--bone); margin: 0; line-height: 1; }
.modal-form p { margin: 0; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* responsive */
@media (max-width: 1000px) {
  .forum-grid { grid-template-columns: 1fr; }
  .cat-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .cat-last { display: none; }
  .cat-edit { grid-template-columns: 1fr 1fr; }
  .cat-edit .grow { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .userbar { margin-left: auto; }
  .userbar .me span, .modlink { font-size: 0; gap: 0; }
  .modlink::before { content: "⚑"; font-size: 20px; }
  .modlink .count { font-size: 12px; margin-left: 2px; }
  .cat-row { grid-template-columns: 1fr; gap: 6px; }
  .cat-stats { display: flex; gap: 14px; }
  .thread-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tr-last { display: none; }
  .post { grid-template-columns: 1fr; }
  .post-author { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .post-author .avatar { width: 36px; height: 36px; font-size: 20px; }
  .post-main { padding: 12px 14px; }
  .note-form { grid-template-columns: 1fr; }
  .profile-head .avatar { width: 64px; height: 64px; font-size: 34px; }
}
