/* ===== Форум Cube RolePlay (поверх style.css) ===== */
.page-forum { background: var(--paper); }
.page-forum .nav__links a[aria-current] { opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

.account { display: flex; align-items: center; gap: 12px; }
.account__me { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.account__me .av { border-radius: 8px; }
.btn--line { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--line:hover { background: var(--black); color: #fff; border-color: var(--black); }
.btn:disabled { opacity: .5; pointer-events: none; }

.forum { max-width: 1120px; margin: 0 auto; padding: 108px var(--gutter) 96px; box-sizing: content-box; min-height: 60vh; outline: none; }
.forum.is-in { animation: fIn .35s var(--ease); }
@keyframes fIn { from { opacity: 0; transform: translateY(8px); } }
.forum__loading { color: var(--grey); padding: 80px 0; }
.av { display: block; border-radius: 10px; background: var(--soft); image-rendering: pixelated; flex: none; }

/* ---------- Шапка форума ---------- */
.fhero {
  position: relative; overflow: hidden;
  padding: clamp(36px, 6vw, 64px); border-radius: 28px;
  background: var(--black) url("assets/logo.png") no-repeat right -60px center / 420px; color: #fff;
}
.fhero h1 { font-size: clamp(48px, 9vw, 112px); font-weight: 800; letter-spacing: -0.04em; line-height: .95; }
.fhero p { margin-top: 16px; max-width: 32em; font-size: 19px; color: rgba(255,255,255,.75); }
.fhero .fhero__stats { margin-top: 28px; font-size: 15px; color: rgba(255,255,255,.55); }

/* ---------- Разделы ---------- */
.fgroup { margin-top: clamp(48px, 7vw, 80px); }
.fgroup h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 20px; }
.cats { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.cat {
  position: relative;
  display: grid; grid-template-columns: 72px minmax(0, 1fr) 110px minmax(0, 260px); align-items: center; gap: 24px;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.cat__line { position: relative; height: var(--line-w); border-radius: 3px; background: var(--c); }
.cat__line::after {
  content: ""; position: absolute; right: -4px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: var(--line-w) solid var(--c);
  transition: background .2s;
}
.cat:hover .cat__line::after { background: var(--c); }
.cat h3 { font-size: 20px; font-weight: 600; }
.cat h3 a { text-decoration: none; }
.cat h3 a::after { content: ""; position: absolute; inset: 0; } /* вся строка кликабельна */
.cat__main p { margin-top: 4px; color: var(--grey); font-size: 15px; }
.cat__count { color: var(--grey); font-size: 15px; }
.cat__count b { display: block; color: var(--ink); font: 600 22px var(--f-display); }
.cat__last { display: grid; gap: 2px; font-size: 14px; min-width: 0; }
.cat__last a { position: relative; z-index: 1; font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat__last a:hover { text-decoration: underline; }
.cat__last span { color: var(--grey); }

/* ---------- Хлебные крошки и заголовки ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 15px; color: var(--grey); margin-bottom: 24px; }
.crumbs > * + *::before { content: "/"; margin-right: 10px; color: var(--rule); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.fhead {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  padding-bottom: 28px; margin-bottom: 8px;
  border-bottom: var(--line-w) solid var(--c);
}
.fhead h1, .thead h1 { font-size: clamp(32px, 5.5vw, 60px); font-weight: 800; letter-spacing: -0.03em; }
.fhead p { margin-top: 10px; color: var(--grey); font-size: 18px; }
.thead { padding-bottom: 24px; border-bottom: var(--line-w) solid var(--c); }
.thead h1 { font-size: clamp(28px, 4.5vw, 48px); overflow-wrap: anywhere; }
.thead .trow__meta { margin-top: 14px; }

/* ---------- Список тем ---------- */
.topics { list-style: none; margin: 0; padding: 0; }
.trow {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 100px 150px; align-items: center; gap: 20px;
  padding: 18px 0; border-bottom: 1px solid var(--rule);
}
.trow.is-pinned { background: linear-gradient(90deg, var(--soft), transparent 70%); }
.trow__title { font-weight: 700; font-size: 17px; text-decoration: none; overflow-wrap: anywhere; }
.trow__title:hover { text-decoration: underline; }
.trow__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 14px; color: var(--grey); }
.trow__replies { font-size: 14px; color: var(--grey); text-align: center; }
.trow__replies b { display: block; color: var(--ink); font: 600 18px var(--f-display); }
.trow__last { font-size: 14px; font-weight: 700; line-height: 1.4; }
.trow__last span { font-weight: 400; color: var(--grey); }

.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 700; }
.badge--open { background: #FFF4D6; color: #7A5600; }
.badge--accepted { background: #DDF5DD; color: #0B6B0B; }
.badge--rejected { background: #FBE0E1; color: #9A0F15; }
.badge--closed { background: #ECECEC; color: #555; }

.pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pager a, .pager span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--rule); text-decoration: none; font-weight: 700; }
.pager a:hover { border-color: var(--ink); }
.pager span { background: var(--black); color: #fff; border-color: var(--black); }

/* ---------- Тема и сообщения ---------- */
.modbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule); background: #fff; font: 500 14px var(--f-body); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip--danger { color: #B51118; }
.chip--danger:hover { border-color: #B51118; }
.chip select { border: 0; background: transparent; font: 700 14px var(--f-body); color: inherit; cursor: pointer; }

.posts { list-style: none; margin: 0; padding: 0; }
.post { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 32px; padding: 32px 0; border-bottom: 1px solid var(--rule); }
.post__author { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.post__author .av { border-radius: 14px; }
.post__author b { font: 600 15px var(--f-display); overflow-wrap: anywhere; }
.role { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--black); color: #fff; }
.role--moderator { background: #4169E1; }
.post__date { font-size: 14px; color: var(--grey); margin-bottom: 12px; }
.post__text { font-size: 17px; line-height: 1.7; overflow-wrap: anywhere; max-width: 70ch; }
.post__text p + p { margin-top: 14px; }
.post__text a { text-underline-offset: 3px; }
.post__del { margin-top: 16px; padding: 0; border: 0; background: none; color: var(--grey); font: 500 14px var(--f-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.post__del:hover { color: #B51118; }

.reply { margin-top: 40px; display: grid; gap: 12px; max-width: 840px; }
.reply label { font: 600 20px var(--f-display); }
.reply .btn { justify-self: start; }
.reply-hint { margin-top: 32px; padding: 24px; border-radius: 20px; background: var(--soft); color: var(--grey); }
.reply-hint a { color: var(--ink); font-weight: 700; }

/* ---------- Формы ---------- */
.card { max-width: 640px; margin: 0 auto; padding: clamp(28px, 5vw, 48px); border: 2px solid var(--rule); border-radius: 28px; }
.form { display: grid; gap: 10px; }
.form h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 800; letter-spacing: -0.02em; }
.form__sub { color: var(--grey); margin-bottom: 14px; }
.form label { font-weight: 700; font-size: 15px; margin-top: 8px; }
.form input:not([type=checkbox]), .form textarea, .reply textarea {
  width: 100%; padding: 14px 16px; border: 2px solid var(--rule); border-radius: 14px;
  font: 400 16px/1.5 var(--f-body); color: var(--ink); background: #fff;
  transition: border-color .2s;
}
.form textarea, .reply textarea { resize: vertical; min-height: 140px; }
.form input:focus, .form textarea:focus, .reply textarea:focus { border-color: var(--ink); outline: none; }
.form__hint { font-size: 14px; color: var(--grey); }
.form__error { padding: 12px 16px; border-radius: 12px; background: #FBE0E1; color: #9A0F15; font-weight: 500; font-size: 15px; }
.form__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.form .btn { margin-top: 8px; }
.form--auth { max-width: 440px; }
.form__logo { border-radius: 16px; margin-bottom: 12px; }
.form__switch { text-align: center; margin-top: 8px; color: var(--grey); }
.form__switch a { color: var(--ink); font-weight: 700; }
.check { display: flex !important; gap: 12px; align-items: flex-start; font-weight: 500 !important; font-size: 14px !important; line-height: 1.5; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--black); }

.empty { text-align: center; padding: 80px 0; display: grid; justify-items: center; gap: 16px; }
.empty h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; }
.empty p { color: var(--grey); max-width: 40ch; }
.empty--inline { padding: 56px 0; }
.empty--inline h2 { font-size: 24px; }

/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
  .page-forum .nav__burger { margin-left: 0; }
  .account { margin-left: auto; }
  .account__me span { display: none; }
  .cat { grid-template-columns: 44px minmax(0, 1fr); gap: 4px 18px; }
  .cat__count, .cat__last { grid-column: 2; }
  .cat__count b { display: inline; font-size: 15px; }
  .cat__last { display: none; }
  .trow { grid-template-columns: 36px minmax(0, 1fr); gap: 4px 14px; }
  .trow .av { width: 36px; height: 36px; }
  .trow__replies { grid-column: 2; text-align: left; }
  .trow__replies b { display: inline; font: inherit; font-weight: 700; color: var(--ink); }
  .trow__last { display: none; }
  .post { grid-template-columns: 1fr; gap: 14px; padding: 24px 0; }
  .post__author { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .post__author .av { width: 40px; height: 40px; border-radius: 10px; }
  .fhero { background-size: 260px; background-position: right -80px bottom -60px; }
}
@media (max-width: 560px) {
  .forum { padding-top: 92px; }
  .fhead .btn { width: 100%; }
  .reply .btn, .form .btn { width: 100%; justify-self: stretch; }
  .card { border: 0; padding: 8px 0; }
}
