/* Prologic Forum — dark game theme */
:root {
  --bg: #0f1014;
  --bg-pattern: url("/img/pattern.png");
  --panel: #17181e;
  --panel-2: #1d1f27;
  --panel-3: #252833;
  --line: #2c2f3b;
  --text: #dcdde3;
  --muted: #8d90a0;
  --accent: #e0245e;
  --accent-2: #ff4f86;
  --accent-soft: rgba(224, 36, 94, 0.14);
  --link: #4fc3f7;
  --ok: #2ecc71;
  --warn: #f1c40f;
  --danger: #e74c3c;
  --radius: 8px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, "Cascadia Code", Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) var(--bg-pattern);
  color: var(--text);
  font: 15px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: #81d4fa; text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; font-weight: 600; }
code, pre { font-family: var(--mono); }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Header */
.site-header {
  background: #0b0b12 url("/img/header.jpg") center 35% / cover no-repeat;
  border-bottom: 1px solid #000;
  box-shadow: inset 0 -80px 80px -40px rgba(0, 0, 0, 0.7);
}
.header-inner, .nav-inner, .container { width: min(1240px, 100% - 32px); margin: 0 auto; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.logo img { display: block; height: 61px; width: auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .8)); }
.userbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.icon-link { position: relative; display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; }
.icon-link svg { width: 20px; height: 20px; fill: currentColor; }
.icon-link:hover { background: var(--accent); text-decoration: none; color: #fff; }
.icon-link.create-link { width: auto; padding: 0 14px 0 10px; gap: 4px; border-radius: 19px; font-weight: 600; font-size: 13px; }
@media (max-width: 860px) { .icon-link.create-link { width: 38px; padding: 0; } .create-label { display: none; } }
.count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.count.warn { background: var(--warn); color: #000; }
.mainnav { background: linear-gradient(#1b1c25, #121219); border-top: 1px solid rgba(255, 255, 255, .05); }
.nav-inner { display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.nav-inner > a { color: #d0d0da; padding: 12px 14px; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.nav-inner > a:hover { color: var(--accent-2); text-decoration: none; }
.nav-search { margin-left: auto; padding: 6px 0; }
.nav-search input { width: 220px; }

/* Menu */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 20px; background: rgba(0, 0, 0, .45); }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 190px; padding: 6px; z-index: 50; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.menu-list a:hover, .menu-list button:hover { background: var(--panel-3); text-decoration: none; }

/* Layout */
main.container { flex: 1; padding: 20px 0 40px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; box-shadow: var(--shadow); overflow: hidden; }
.panel-title { margin: 0; padding: 12px 16px; font-size: 1rem; font-weight: 600; background: linear-gradient(90deg, var(--accent-soft), transparent 60%), var(--panel-2); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em; }
h1.panel-title { font-size: 1.05rem; }
.panel-body { padding: 16px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid-2 .panel { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head p { margin: 0; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs .sep { opacity: .6; }
.notice { background: var(--panel-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.notice.warn { border-color: var(--warn); }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.flash.ok { background: rgba(46, 204, 113, .12); border: 1px solid rgba(46, 204, 113, .35); }
.flash.err { background: rgba(231, 76, 60, .12); border: 1px solid rgba(231, 76, 60, .4); }
.filters { display: flex; gap: 6px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; font-size: 13px; }
.filters a { padding: 3px 10px; border-radius: 14px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.filters a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-3); color: var(--text); padding: 7px 14px; border-radius: 6px; font: 600 14px var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #444859; text-decoration: none; color: #fff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: rgba(0, 0, 0, .35); }
.btn.danger { background: transparent; border-color: rgba(231, 76, 60, .6); color: #ff8a7d; }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.linklike { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: #ff8a7d; }
.linklike.ok { color: var(--ok); }
input, select, textarea {
  font: inherit; color: var(--text); background: #0f1015; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=file] { padding: 6px; }
.form label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.form label input, .form label select, .form label textarea { margin-top: 4px; font-weight: 400; }
.form label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.field-error { display: block; color: #ff8a7d; font-weight: 400; font-size: 13px; margin-top: 3px; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.inline, form.inline { display: inline; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.inline-form input, .inline-form select { width: auto; min-width: 160px; }
.inline-form input[type="checkbox"], .inline-form input[type="radio"] { min-width: 0; }
.inline-label select { width: auto; margin-left: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 160px; }
.row.checks > label { flex: 0 0 auto; }

/* Badges */
.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; margin-right: 4px; }
.badge-pin { background: rgba(46, 204, 113, .18); color: var(--ok); }
.badge-featured { background: rgba(241, 196, 15, .16); color: #f5c542; }
.badge-lock { background: rgba(141, 144, 160, .2); color: var(--muted); }
.badge-warn { background: rgba(241, 196, 15, .18); color: var(--warn); }
.badge-del { background: rgba(231, 76, 60, .2); color: #ff8a7d; }
.badge-ok { background: rgba(46, 204, 113, .18); color: var(--ok); }
.badge-lang { background: rgba(79, 195, 247, .16); color: var(--link); }
.badge-new { background: var(--accent); color: #fff; }
.badge-bot { background: #3b3f52; color: #c5c9db; font-size: 10px; }

/* Member names and avatars */
.member-name { font-weight: 600; background-position: center !important; }
.member-link:hover { text-decoration: none; }
.member-link:hover .member-name { text-decoration: underline; }
.avatar { border-radius: 50%; object-fit: cover; background: var(--panel-3); flex-shrink: 0; }
.avatar.xs { width: 26px; height: 26px; }
.avatar.sm { width: 36px; height: 36px; }
.avatar.md { width: 48px; height: 48px; }
.avatar.lg { width: 96px; height: 96px; border-radius: 10px; }
.avatar.xl { width: 120px; height: 120px; border-radius: 12px; }
.online-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 12px; font-weight: 600; }
.online-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.rep { color: var(--ok); }

/* Forum list */
.forum-list, .topic-list, .activity, .notif-list { list-style: none; margin: 0; padding: 0; }
.forum-row, .topic-row { display: grid; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.forum-row:last-child, .topic-row:last-child { border-bottom: 0; }
.forum-row { grid-template-columns: 44px 1fr 110px 260px; }
.forum-row:hover, .topic-row:hover { background: rgba(255, 255, 255, .02); }
.forum-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.forum-icon svg { width: 22px; height: 22px; fill: var(--accent-2); }
.forum-name { font-size: 1.05rem; font-weight: 600; color: #fff; }
.forum-main p { margin: 2px 0 0; font-size: 13.5px; }
.subforums { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 16px; }
.subforums li { display: inline-flex; align-items: center; }
.subforums li::before { content: ""; width: 9px; height: 7px; margin: 0 7px 4px 2px; border-left: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); }
.subforums a { font-weight: 600; font-size: 14px; }
.forum-stats, .topic-stats { font-size: 12.5px; color: var(--muted); text-align: right; }
.forum-stats strong, .topic-stats strong { color: var(--text); }
.forum-stats .stat, .topic-stats .stat, .topic-last .stat { display: block; }
.forum-last, .topic-last { font-size: 13px; min-width: 0; }
.clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-row { grid-template-columns: 36px 1fr 100px 170px; }
.topic-row.pinned { background: linear-gradient(90deg, rgba(46, 204, 113, .05), transparent 50%); }
.topic-row.hidden-row { opacity: .65; }
.topic-row.has-check { grid-template-columns: 20px 36px 1fr 100px 170px; }
.mod-check { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
/* The bulk bar sits in the page; once something is ticked it floats at the bottom of the screen, where it never
   covers the top of a post. A spacer of the same height keeps the page from jumping. */
.mod-bar.mass-mod { background: #1d1c18; }
.mod-bar.mass-mod.floating { position: fixed; z-index: 40; bottom: 14px; left: 50%; transform: translateX(-50%); width: min(1240px, calc(100% - 32px));
  margin: 0; border-style: solid; border-color: rgba(241, 196, 15, .45); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.mass-mod-spacer { margin-bottom: 12px; }
.mod-bar input[type="text"] { width: 230px; max-width: 100%; padding: 5px 9px; }
.mass-mod .check { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.post-check { display: inline-flex; gap: 6px; align-items: center; margin: 0 0 0 auto; font-size: 12px; color: var(--muted); }
.post-check + .post-link { margin-left: 0; }
.post-ip { margin-left: auto; white-space: nowrap; }
.post-ip + .post-check { margin-left: 10px; }
@media (max-width: 860px) { .post-meta { flex-wrap: wrap; } .post-ip { order: 9; flex-basis: 100%; margin-left: 0; } .post-ip + .post-check { margin-left: auto; } }
.mod-history { margin-top: 4px; width: 100%; }
.mod-history ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.topic-row.unread .topic-title a { font-weight: 700; }
.topic-title a { color: #fff; font-weight: 600; font-size: 15.5px; }
.topic-main { min-width: 0; }
.stats .panel-body p { margin: 0 0 6px; }

/* Topic and posts */
.mod-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: rgba(241, 196, 15, .06); border: 1px dashed rgba(241, 196, 15, .3); border-radius: var(--radius); margin-bottom: 12px; }
.mod-bar select { width: auto; padding: 4px 8px; }
.post { display: grid; grid-template-columns: 200px 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 16px; }
.post:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.post.pending { border-color: rgba(241, 196, 15, .5); }
.post.deleted { opacity: .6; }
.post-author { background: var(--panel-2); border-right: 1px solid var(--line); padding: 18px 14px; text-align: center; }
.author-name { font-size: 1.05rem; margin-top: 8px; }
.author-group { color: var(--muted); font-size: 12.5px; }
.author-title { font-size: 12.5px; color: var(--warn); margin-top: 2px; }
.author-stats { display: grid; grid-template-columns: auto auto; gap: 2px 10px; font-size: 12.5px; margin: 12px 0 8px; text-align: left; }
.author-stats dt { color: var(--muted); }
.author-stats dd { margin: 0; text-align: right; }
.post-content { min-width: 0; display: flex; flex-direction: column; }
.post-meta { display: flex; gap: 10px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.post-link { margin-left: auto; }
.post-body { padding: 16px 18px; overflow-wrap: anywhere; flex: 1; }
.post-body > :first-child { margin-top: 0; }
.post-body img { height: auto; border-radius: 4px; }
.post-body img.emote { vertical-align: middle; border-radius: 0; height: 1.6em; width: auto; }
.post-body table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.post-body td, .post-body th { border: 1px solid var(--line); padding: 6px 10px; }
.post-body pre { background: #0b0c10; border: 1px solid var(--line); padding: 12px; border-radius: 6px; overflow-x: auto; }
.post-body code { background: #0b0c10; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.post-body pre code { background: none; padding: 0; }
.post-body blockquote, .post-body .ipsQuote { margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: rgba(255, 255, 255, .03); border-radius: 0 6px 6px 0; }
.post-body .ipsQuote_citation { font-weight: 600; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.post-body .spoiler { background: #0b0c10; border: 1px dashed var(--line); border-radius: 6px; padding: 10px 14px; filter: blur(5px); cursor: pointer; transition: filter .2s; }
.post-body .spoiler.open { filter: none; cursor: auto; }
.post-body .mention { background: var(--accent-soft); padding: 0 4px; border-radius: 4px; color: var(--accent-2); }
.post-body iframe.embed-video { width: 100%; max-width: 640px; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 6px; }
.post-body hr { border: 0; border-top: 1px solid var(--line); }
.post-body ul.contains-task-list { list-style: none; padding-left: 4px; }
.edited { padding: 0 18px; margin: 0 0 8px; }
.signature { margin: 0 18px 10px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.post-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 18px 12px; }
.post-buttons { display: flex; gap: 14px; align-items: center; font-size: 13.5px; flex-wrap: wrap; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.reaction { display: inline-flex; align-items: center; gap: 6px; height: 30px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 0 11px 0 8px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: default; transition: border-color .15s, background .15s, color .15s; }
.reaction-emoji { font-size: 17px; line-height: 1; display: inline-block; transition: transform .15s ease; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.reaction-count { color: var(--text); min-width: 0; }
.reaction-count:empty { display: none; }
button.reaction { cursor: pointer; }
button.reaction.zero .reaction-emoji { filter: saturate(.75); }
button.reaction:hover { border-color: #565b70; background: var(--panel-3); color: var(--text); }
button.reaction:hover .reaction-emoji { transform: scale(1.22) rotate(-6deg); }
button.reaction:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.reaction.mine { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.reaction.pop .reaction-emoji { animation: reaction-pop .35s ease; }
@keyframes reaction-pop { 0% { transform: scale(1); } 45% { transform: scale(1.45); } 100% { transform: scale(1); } }
.reaction.legacy { opacity: .7; padding: 0 10px 0 8px; }
/* Labels only where there is room: on phones the buttons show the icon and count. */
@media (max-width: 860px) { .reaction-label { display: none; } .reaction { padding: 0 10px; } }
.report summary { list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.report form { display: flex; gap: 6px; margin-top: 6px; }
.report input { width: 240px; padding: 4px 8px; }
.reply-box .form-actions { justify-content: flex-end; }

/* Pager */
.pager { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px 0 14px; }
.pager a, .pager span { padding: 4px 10px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); font-size: 13.5px; color: var(--text); }
.pager .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .gap { background: none; border: 0; }

/* Editor */
.editor { border: 1px solid var(--line); border-radius: var(--radius); background: #0f1015; }
.editor-tabs { display: flex; gap: 2px; align-items: center; border-bottom: 1px solid var(--line); padding: 4px 6px 0; }
.editor-tabs .tab { background: none; border: 0; color: var(--muted); padding: 6px 12px; font: 600 13px var(--font); cursor: pointer; border-bottom: 2px solid transparent; }
.editor-tabs .tab.active { color: #fff; border-color: var(--accent); }
.format-pick { margin-left: auto; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.format-pick select { width: auto; padding: 2px 6px; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line); align-items: center; }
.editor-toolbar button, .upload-btn, .emote-picker summary { background: none; border: 0; color: var(--text); padding: 4px 9px; border-radius: 4px; cursor: pointer; font: 13px var(--font); list-style: none; }
.editor-toolbar button:hover, .upload-btn:hover, .emote-picker summary:hover { background: var(--panel-3); }
.emote-picker { position: relative; }
.emote-picker summary::-webkit-details-marker { display: none; }
.emote-grid { position: absolute; z-index: 20; top: 100%; left: 0; width: 360px; max-height: 280px; overflow: auto; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.emote-grid button { padding: 2px; }
.emote-grid img { height: 28px; width: auto; display: block; }
.editor textarea { border: 0; border-radius: 0 0 var(--radius) var(--radius); min-height: 140px; resize: vertical; background: transparent; }
.editor textarea:focus { box-shadow: none; outline: none; }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-toolbar .upload-btn { display: inline-block; margin: 0; font: 13px var(--font); font-weight: 400; }
.upload-btn:focus-within { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.editor-tabs { flex-wrap: wrap; }
.editor-preview { min-height: 140px; border-radius: 0 0 var(--radius) var(--radius); }
.editor.dragging { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-help { margin: 6px 2px 0; }

/* Messages */
.messages { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.message { display: flex; gap: 10px; align-items: flex-start; max-width: 860px; }
.message-body { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; min-width: 0; flex: 1; }
.message-body .post-body { padding: 4px 0; }
.message.mine { margin-left: auto; flex-direction: row-reverse; }
.message.mine .message-body { background: #1f1a24; border-color: rgba(224, 36, 94, .35); }

/* Notifications, activity, search */
.notif-list li { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.notif-list li.unread { background: var(--accent-soft); }
.notif-list li a { flex: 1; color: var(--text); }
.activity li { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.activity li p { margin: 4px 0 0; font-size: 14px; }
.snippet mark { background: rgba(241, 196, 15, .3); color: #fff; border-radius: 2px; padding: 0 2px; }
.search-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-form input { flex: 1 1 280px; }
.search-form select { width: auto; }

/* Profile and members */
.profile-head { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 20px; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 4px 0; }
.profile-stats { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 24px; margin: 0; }
.profile-stats dt { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.profile-stats dd { margin: 0; font-size: 1.2rem; font-weight: 600; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px; padding: 8px; }
.member-card { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 6px; }
.member-card:hover { background: var(--panel-2); }

/* Moderation and admin */
.queue-item { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.queue-item .post-body { padding: 10px 0; }
.clip-body { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 10px !important; margin: 8px 0; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.admin-nav a { padding: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 13.5px; }
.admin-nav a:hover { border-color: var(--accent); text-decoration: none; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.tile span { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.tile strong { font-size: 1.6rem; margin: 2px 0; }
.tile em { font-style: normal; color: var(--muted); font-size: 13px; }
.tile.warn { border-color: rgba(241, 196, 15, .5); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table th, .table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; }
.table tr.muted td { opacity: .55; }
.forum-edit, .member-edit { margin-bottom: 10px; }
.forum-edit label, .member-edit label { font-size: 13px; }
.member-edit-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.settings-form label { max-width: 720px; }
.emote-admin { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.emote-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; min-width: 80px; }
.secret-box code { display: block; padding: 10px; background: #0b0c10; border-radius: 6px; margin: 6px 0; user-select: all; overflow-wrap: anywhere; cursor: copy; }
.pow-status:empty { display: none; }
.cf-turnstile { margin: 8px 0 12px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #0b0b10; padding: 18px 0; font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-inner a { color: var(--muted); }

/* Phones and narrow screens */
@media (max-width: 860px) {
  .forum-stats .stat, .topic-stats .stat, .topic-last .stat { display: inline; margin-right: 12px; }
  .forum-row { grid-template-columns: 40px 1fr; }
  .forum-stats, .forum-last { grid-column: 2; text-align: left; }
  .topic-row { grid-template-columns: 36px 1fr; }
  .topic-stats, .topic-last { grid-column: 2; text-align: left; }
  .topic-row.has-check { grid-template-columns: 20px 36px 1fr; }
  .mod-bar.mass-mod.floating { bottom: 8px; width: calc(100% - 16px); padding: 8px 10px; }
  .topic-row.has-check .topic-stats, .topic-row.has-check .topic-last { grid-column: 3; }
  .post { grid-template-columns: 1fr; }
  .post-author { display: flex; gap: 12px; text-align: left; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; align-items: center; }
  .post-author .avatar.lg { width: 44px; height: 44px; }
  .author-name { margin: 0; }
  .author-stats, .post-author .online-dot { display: none; }
  .profile-head { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .nav-inner { flex-wrap: wrap; overflow: visible; gap: 0 2px; padding: 4px 0 8px; }
  .nav-inner > a { padding: 9px 10px; font-size: 12.5px; }
  .nav-search { margin-left: 0; flex-basis: 100%; padding: 4px 0 0; }
  .nav-search input { width: 100%; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .userbar { justify-content: flex-start; }
  .report input { width: 150px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Tags and new-post markers */
.tag { display: inline-block; padding: 1px 8px; margin: 0 4px 2px 0; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line); color: #c9cbe0; font-size: 12px; font-weight: 600; vertical-align: middle; }
.tag:hover { border-color: var(--accent); text-decoration: none; color: #fff; }
.tag.big { font-size: 1rem; padding: 2px 12px; }
.tag-more { background: transparent; color: var(--muted); }
.topic-title .tag { font-size: 12px; color: #c9cbe0; }
.topic-title .tag-more { color: var(--muted); }
.tags { margin: 0 0 4px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
a.badge-new:hover { text-decoration: none; filter: brightness(1.15); }
.forum-row.has-new .forum-icon { background: var(--accent); box-shadow: 0 0 12px rgba(224, 36, 94, .5); }
.forum-row.has-new .forum-icon svg { fill: #fff; }
.forum-row.has-new .forum-name::after { content: "New"; margin-left: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
.index-head { margin-bottom: 8px; justify-content: flex-end; }
.about { padding: 0 20px 18px; }

/* Rich text editor for staff */
.editor-visual { min-height: 260px; padding: 12px 14px; outline: none; border-radius: 0 0 var(--radius) var(--radius); }
.editor-visual:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.rich-only { display: inline-flex; flex-wrap: wrap; gap: 2px; align-items: center; border-left: 1px solid var(--line); margin-left: 4px; padding-left: 4px; }
.rich-only[hidden] { display: none; }
.color-btn { position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 4px; cursor: pointer; font-weight: 700; }
.color-btn input { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.color-btn:hover { background: var(--panel-3); }

/* Footer RSS menu opens upwards. */
.rss-menu summary { background: transparent; padding: 0; color: var(--muted); gap: 6px; }
.rss-menu summary:hover { color: var(--text); }
.rss-icon { width: 14px; height: 14px; fill: #f39c12; }
.menu-up .menu-list { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
.narrow-panel { max-width: 560px; margin: 0 auto; }
.narrow-panel .stack { display: grid; gap: 14px; }

/* Review fixes: long words never widen the page, visible focus, and touch-friendly sizes. */
h1, .crumbs, .topic-main, .topic-last, .forum-main, .forum-last, .author-name, .post-body, .message-body, .profile-head, .panel-title { overflow-wrap: anywhere; }
.page-head > * { min-width: 0; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.nav-active { color: #fff !important; box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 860px) {
  /* The user menu opens inside the screen even when the header wraps onto two rows. */
  .userbar { position: relative; }
  .userbar .menu { position: static; }
  .userbar .menu-list { left: 0; right: auto; }
  /* The emote picker spans the editor instead of running off the right edge. */
  .editor-toolbar { position: relative; }
  .emote-picker { position: static; }
  .emote-grid { left: 6px; right: 6px; width: auto; }
  /* Admin tables scroll sideways instead of being cut off. */
  .panel > .table, .panel-body > .table { display: block; overflow-x: auto; white-space: nowrap; }
  /* Bigger tap targets. */
  .post-buttons a, .post-buttons .linklike, .crumbs a, .footer-inner a { display: inline-flex; align-items: center; min-height: 36px; }
  .editor-toolbar button, .editor-toolbar .upload-btn, .emote-picker summary { min-height: 36px; min-width: 36px; }
  .mod-check { width: 22px; height: 22px; }
  .topic-row { row-gap: 2px; }
}
/* Tablets keep a two-column topic list and a narrow author column instead of the phone layout. */
@media (min-width: 600px) and (max-width: 860px) {
  .topic-row { grid-template-columns: 36px 1fr 120px; }
  .topic-row .topic-stats { grid-column: 3; grid-row: 1; text-align: right; }
  .topic-row .topic-last { grid-column: 2 / 4; }
  .topic-row.has-check { grid-template-columns: 20px 36px 1fr 120px; }
  .topic-row.has-check .topic-stats { grid-column: 4; grid-row: 1; }
  .topic-row.has-check .topic-last { grid-column: 3 / 5; }
  .post { grid-template-columns: 150px 1fr; }
  .post-author { display: block; text-align: center; border-right: 1px solid var(--line); border-bottom: 0; padding: 14px 10px; }
  .post-author .avatar.lg { width: 64px; height: 64px; }
}

/* Editor toolbar: grouped buttons, text size, colour palette, alignment icons, a bigger emote button. */
.editor-toolbar { gap: 4px; padding: 6px 8px; }
.tool-group { display: inline-flex; align-items: center; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.tool-group:last-child { border-right: 0; }
.tool-group[hidden] { display: none; }
.editor-toolbar button { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; }
.editor-toolbar svg { width: 15px; height: 15px; fill: currentColor; }
.editor-toolbar select { width: auto; height: 30px; padding: 2px 6px; font-size: 13px; background: var(--panel-2); }
.color-picker { position: relative; }
.color-picker summary { list-style: none; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 4px; }
.color-picker summary::-webkit-details-marker { display: none; }
.color-picker summary:hover { background: var(--panel-3); }
.color-a { font-weight: 700; font-size: 14px; line-height: 1; }
.color-bar { width: 16px; height: 3px; margin-top: 2px; border-radius: 2px; background: #2ecc71; }
.swatches { position: absolute; z-index: 25; top: 100%; left: 0; display: grid; grid-template-columns: repeat(6, 26px); gap: 6px; padding: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.swatch { width: 26px !important; height: 26px !important; min-width: 0 !important; padding: 0 !important; border-radius: 50% !important; border: 2px solid rgba(255, 255, 255, .25) !important; }
.swatch:hover { transform: scale(1.12); border-color: #fff !important; }
.swatch-auto { grid-column: 1 / -1; display: flex !important; justify-content: flex-start !important; gap: 8px; height: 30px !important; padding: 0 8px !important; border: 1px solid var(--line) !important; border-radius: 6px; font-size: 13px; }
.swatch-auto-chip { width: 16px; height: 16px; border-radius: 4px; background: var(--text); }
.swatch-more { grid-column: 1 / -1; position: relative; text-align: center; padding: 6px 0 0; margin: 0; font-size: 13px; color: var(--link); cursor: pointer; }
.swatch-more input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.emote-picker summary { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 30px; }
.emote-icon { font-size: 20px; line-height: 1; }
.editor-visual { min-height: 220px; }
.editor-visual:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.editor-visual img { max-width: 100%; }
.attach-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-top: 1px dashed var(--line); background: rgba(255, 255, 255, .02); border-radius: 0 0 var(--radius) var(--radius); color: var(--muted); font-size: 13.5px; }
.attach-bar svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.attach-bar .md-help { margin: 0 0 0 auto; }
.choose-files { cursor: pointer; text-decoration: underline; color: var(--accent-2); }
.editor.dragging .attach-bar { color: var(--text); background: var(--accent-soft); }
.mod-options { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 12px; border: 1px dashed rgba(241, 196, 15, .3); border-radius: var(--radius); background: rgba(241, 196, 15, .04); }
.mod-options legend { padding: 0 6px; color: #f5c542; font-weight: 600; font-size: 13px; }
@media (max-width: 860px) {
  .tool-group { border-right: 0; padding-right: 0; }
  .color-picker { position: static; }
  .swatches { left: 6px; right: 6px; grid-template-columns: repeat(6, 1fr); justify-items: center; }
  .attach-bar .md-help { margin: 0; }
}
.editor-visual hr { cursor: pointer; padding: 4px 0; background-clip: content-box; }
.editor-visual hr.picked { outline: 2px solid var(--accent); outline-offset: 2px; }
