/* =====================================================
   ArmComix — Mobile-First CSS Rewrite
   =====================================================
   Breakpoints:
   - Base:    0–599px   (phones)
   - SM:      600px+    (large phones / small tablets)
   - MD:      768px+    (tablets)
   - LG:      960px+    (small desktop, sidebar appears)
   - XL:      1220px+   (full desktop)
   ===================================================== */

/* === RESET & BASE === */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;outline:none;border:0}
ol,ul{list-style:none}
img{max-width:100%;height:auto;display:block}
img[data-sizes="auto"]{width:100%}
a{color:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent}
b,strong{font-weight:600}
article,aside,figure,footer,header,nav,section,main{display:block}

body{
  font-family: 'PT Sans', Calibri, Tahoma, Geneva, sans-serif;
  font-size: 16px;               /* 16px предотвращает авто-зум в iOS */
  line-height: 1.55;
  color: #1a1a1a;
  background-color: #f5f6f8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* отступ под sticky header */
  padding-top: 56px;
}

/* Отключаем hover на touch устройствах */
@media (hover: hover) {
  a:hover { color: #ff934b; }
}

.clearfix::after { content: ""; display: table; clear: both; }
.clr { clear: both; }

/* === TYPOGRAPHY === */
h1,h2,h3,h4,h5 { font-weight: 600; line-height: 1.3; }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.125rem; }

/* === UTILITY === */
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex-row { display: flex; flex-wrap: wrap; justify-content: space-between; }
.lbd-center { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 12px; position: relative; }

/* === TRANSITIONS (для устройств с hover) === */
@media (hover: hover) {
  a, button, .button { transition: color .2s, background-color .2s, opacity .2s; }
}

/* === BUTTONS === */
.button, .lbd-load a, button:not(.color-btn),
input[type="submit"], input[type="reset"], input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  min-height: 44px;            /* Минимум 44px для touch */
  color: #fff;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  background-color: #E67E22;
  border-radius: 6px;
  cursor: pointer;
  -webkit-appearance: none;
}
@media (hover: hover) {
  .button:hover, button:not(.color-btn):hover,
  input[type="submit"]:hover { opacity: .85; }
}
button:active, input[type="submit"]:active {
  transform: scale(.97);
}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}

/* === FORM ELEMENTS === */
input[type="text"], input[type="password"],
input[type="email"], input[type="search"],
input[type="file"], select {
  display: block;
  width: 100%;
  height: 48px;
  line-height: 48px;
  padding: 0 16px;
  font-size: 16px;           /* >= 16px для предотвращения зума iOS */
  color: #1a1a1a;
  background-color: #f8f8f8;
  border-radius: 8px;
  -webkit-appearance: none;
  border: 1px solid #e5e5e5;
}
input:focus, select:focus, textarea:focus {
  border-color: #E67E22;
  box-shadow: 0 0 0 3px rgba(168,217,93,.25);
}
textarea {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #e5e5e5;
  background-color: #f8f8f8;
  border-radius: 8px;
  resize: vertical;
  min-height: 120px;
}
input:focus::-webkit-input-placeholder { color: transparent; }
select { height: 48px; }

/* BBcodes buttons */
input[type="submit"].bbcodes, input[type="button"].bbcodes,
input.bbcodes, .ui-button {
  font-size: 12px !important;
  height: 36px !important;
  line-height: 36px !important;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 4px;
}

/* === IMAGE CONTAINERS === */
.lbd-img, .lbd-cover { overflow: hidden; position: relative; }
.lbd-img img, .lbd-cover img { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================
   HEADER (sticky, mobile-first)
   ===================================================== */
.lbd-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 12px;
  background: #E67E22;
  height: 56px;
}
.lbd-header__inner {
  display: flex;
  align-items: center;
  height: 56px;
  gap: 10px;
}

/* — Гамбургер-кнопка — */
button.lbd-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  background: rgba(255,255,255,.15);
  cursor: pointer;
  flex-shrink: 0;
  min-height: 44px;
  border-radius: 8px;
  color: #fff;
  text-transform: none;
  line-height: normal;
}
.lbd-burger__line {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
/* Анимация X при открытии */
.lbd-burger--open .lbd-burger__line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.lbd-burger--open .lbd-burger__line:nth-child(2) { opacity: 0; }
.lbd-burger--open .lbd-burger__line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* — Логотип — */
.lbd-logo {
  display: block;
  width: 120px;
  flex-shrink: 0;
}
.lbd-logo img { width: 100%; }

/* — Поиск (скрыт на мобилках, виден через drawer) — */
.lbd-search { display: none; }

/* — Кнопка авторизации — */
.lbd-login-wrap { margin-left: auto; }
.lbd-login-label { display: none; }
.lbd-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}
.lbd-login-btn .fa { margin: 0; }

/* =====================================================
   MOBILE DRAWER
   ===================================================== */
.lbd-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2000;
  pointer-events: none;
  visibility: hidden;
}
.lbd-drawer--open {
  pointer-events: auto;
  visibility: visible;
}
.lbd-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .3s;
}
.lbd-drawer--open .lbd-drawer__overlay { opacity: 1; }

.lbd-drawer__panel {
  position: absolute;
  top: 0; left: 0;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: #fff;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}
.lbd-drawer--open .lbd-drawer__panel { transform: translateX(0); }

.lbd-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #E67E22;
  color: #fff;
  font-weight: 600;
  font-size: 1.125rem;
}
button.lbd-drawer__close {
  width: 44px; height: 44px;
  font-size: 28px;
  background: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0;
  text-transform: none;
  line-height: normal;
}

.lbd-drawer__search {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}
.lbd-drawer__search input {
  height: 44px;
  border-radius: 8px;
}

.lbd-drawer__nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}
.lbd-drawer__nav li a .fa { color: #ff934b; width: 20px; text-align: center; }
.lbd-drawer__nav li a:active { background: #f5f5f5; }

.lbd-drawer__sub {
  padding: 14px 16px 8px;
  font-weight: 600;
  font-size: .875rem;
  text-transform: uppercase;
  color: #888;
}
.lbd-drawer__cats .asideNav li a {
  display: block;
  padding: 12px 16px;
  min-height: 44px;
  border-bottom: 1px solid #f0f0f0;
  font-size: .9375rem;
}

/* =====================================================
   DESKTOP NAVIGATION (f-menu)
   ===================================================== */
.lbd-nav { display: none; }

/* =====================================================
   LAYOUT — MAIN CONTENT + SIDEBAR
   ===================================================== */
.lbd-block {
  background: #fff;
}
.lbd-cols {
  display: flex;
  flex-direction: column;
}
.lbd-main {
  width: 100%;
  min-height: 60vh;
  padding: 12px;
  order: 1;
}
.lbd-side {
  width: 100%;
  padding: 12px;
  background: #fafbfc;
  border-top: 1px solid #eee;
  order: 2;
}

/* =====================================================
   CARD GRID (shortstory, search results)
   ===================================================== */
.lbd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.lbd-grid > br { display: none; }

/* Элементы на полную ширину (speedbar, sort, info, пагинация) */
.lbd-heading, .lbd-breadcrumb, .lbd-sort, .info,
.lbd-pager, .navigation, .lbd-pagi, .lbd-load,
.main__h1-wrapper,
.lbd-grid > :not(.lbd-card):not(.lbd-card-search):not(.lbd-card-main):not(br) {
  grid-column: 1 / -1;
}

.lbd-card, .lbd-card-search, .lbd-card-main {
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.lbd-card .lbd-cover, .lbd-card .lbd-img,
.lbd-card-search .lbd-cover, .lbd-card-search .lbd-img,
.lbd-card-main .lbd-cover, .lbd-card-main .lbd-img {
  aspect-ratio: 2/3;
}

.lbd-card-name {
  display: block;
  padding: 8px;
  text-align: center;
  text-transform: uppercase;
  font-weight: 600;
  font-size: .75rem;
  line-height: 1.3;
  min-height: 40px;
  overflow: hidden;
}
@media (hover: hover) {
  .lbd-card-name:hover { color: #ff934b; }
}

/* Рейтинг на карточке */
.lbd-badge {
  position: absolute;
  top: 8px; left: 0;
  background: #60ab08;
  color: #fff;
  font-weight: 600;
  padding: 4px 10px;
  font-size: .8125rem;
  line-height: 1;
  border-radius: 0 4px 4px 0;
  z-index: 2;
}

/* =====================================================
   TITLE MODULES (override engine2.css)
   ===================================================== */
.lbd-heading {
  text-transform: uppercase;
  position: relative;
  padding: 12px 16px;
  font-size: .875rem;
  margin: 24px 0 16px;
  clear: both;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #E67E22;
}
.lbd-heading::before { display: none; }
.lbd-heading span {
  position: relative;
  color: #333;
  background: transparent;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 0;
  font-size: 1.125rem;
}

.lbd-heading2 {
  text-transform: uppercase;
  text-align: center;
  position: relative;
  padding: 12px 10px;
  font-size: 16px;
  margin-bottom: 10px;
  clear: both;
  background: #E67E22;
  border-radius: 6px;
}
/* Убираем горизонтальную линию из engine2.css */
.lbd-heading2::before {
  display: none !important;
}
.lbd-heading2 span {
  position: relative;
  color: #fff;
  background: transparent;
  z-index: 55;
  padding: 0;
  font-weight: 700;
  font-size: 1rem;
}

/* =====================================================
   SORT BAR
   ===================================================== */
.lbd-sort {
  padding: 10px 0;
  font-size: .875rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.lbd-sort::-webkit-scrollbar { display: none; }
.lbd-sort a { margin: 0 4px; }

/* =====================================================
   SEARCH PAGE — fix gap between form and results
   ===================================================== */
.search-block {
  min-height: auto !important;
  max-height: none;
}
.search-block.lbd-block {
  min-height: auto !important;
  padding: 12px 0;
  background: transparent;
}
#searchtable { padding: 0 0 12px; }
.search-page { margin-bottom: 12px; }
.search-additional { margin-bottom: 8px; }
.search-block__count { margin-bottom: 4px; }

/* Fullstory tags (keywords) — переопределение */
.lbd-info .lbd-tag,
.lbd-info .lbd-tag-link {
  margin: 3px 4px 3px 0;
}
.lbd-text .lbd-tags {
  gap: 10px;
  margin: 16px 0;
}

/* =====================================================
   SPEEDBAR (breadcrumbs)
   ===================================================== */
.lbd-breadcrumb {
  padding: 8px 12px;
  font-size: .8125rem;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.lbd-breadcrumb::-webkit-scrollbar { display: none; }
@media (hover: hover) {
  .lbd-breadcrumb a:hover { color: #ff934b; }
}

/* =====================================================
   SIDEBAR COMPONENTS
   ===================================================== */
.lbd-widget { margin-bottom: 16px; }
.lbd-side a { color: #555; }
@media (hover: hover) {
  .lbd-side a:hover, .lbd-side a.active { color: #ff934b; }
}

.lbd-widget-link {
  display: block;
  width: 100%;
  min-height: 44px;
  line-height: 44px;
  padding: 0 16px;
  text-transform: uppercase;
  background: rgba(251,140,2,.77);
  color: #fff;
  font-weight: 500;
  font-size: .9375rem;
  border-radius: 6px;
  margin-bottom: 8px;
}

.lbd-widget-body { padding: 4px; }
.lbd-widget-body.flex-row { padding-bottom: 0; }

.lbd-thumb {
  width: 48%;
  display: block;
  margin-bottom: 12px;
}
.lbd-thumb-img {
  aspect-ratio: 2/3;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
  overflow: hidden;
}
@media (hover: hover) {
  .lbd-thumb-img:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); transition: all .2s; }
}
.lbd-thumb-name {
  font-size: .8125rem;
  line-height: 1.3;
  color: #333;
  max-height: 48px;
  overflow: hidden;
}

/* =====================================================
   SITE-DESC (SEO текст)
   ===================================================== */
.lbd-seo {
  border-top: 1px solid #eee;
  padding: 16px 0;
}
.lbd-seo h1, .lbd-seo h2, .lbd-seo h3 {
  font-size: 1.125rem;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-align: center;
}
.lbd-seo p { line-height: 1.6; margin-bottom: 12px; }
.lbd-seo a { text-decoration: underline; font-weight: 500; }
.lbd-seo img {
  float: left;
  margin: 0 16px 8px 0;
  width: 120px;
  border-radius: 6px;
}

/* =====================================================
   FULL STORY (статья)
   ===================================================== */
.lbd-page { padding: 12px 0; }
.lbd-title { margin-bottom: 16px; }
.lbd-title h1 {
  font-size: 1.25rem;
  text-transform: uppercase;
  line-height: 1.4;
}

/* Постер + инфо (мобильный = вертикально) */
.lbd-detail { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.lbd-poster { width: 100%; max-width: 250px; margin: 0 auto; aspect-ratio: 2/3; overflow: hidden; background: #f0f0f0; border-radius: 6px; }
.lbd-poster img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.lbd-info { width: 100%; }
.lbd-meta { margin: 0; }
.lbd-meta__row {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: .9375rem;
  line-height: 1.5;
}
.lbd-meta__row dt {
  font-weight: 600;
  flex-shrink: 0;
  min-width: 130px;
}
.lbd-meta__row dd { margin: 0; min-width: 0; overflow-wrap: break-word; }
figure.lbd-poster { margin: 0; }

/* Full text content */
.lbd-text {
  line-height: 1.7;
  font-size: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.lbd-text img:not(.emoji) {
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border-radius: 4px;

}
.lbd-text a { text-decoration: underline; color: #8c45c5; }
@media (hover: hover) {
  .lbd-text a:hover { text-decoration: none; }
}
.lbd-text h2,.lbd-text h3,.lbd-text h4 { margin: 16px 0 8px; font-size: 1rem; }
.lbd-text p { margin-bottom: 8px; }

.lbd-desc { margin-bottom: 16px; }
.dlc { border-top: 2px dotted #ececec; }
.dlc b { display: block; color: #e84629; padding-top: 5px; }

/* Скриншоты */
.itscr { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.itscr img { width: 100%; max-width: 200px; border-radius: 4px; }

/* Избранное — кнопка внизу статьи */
.lbd-fav {
  margin: 20px 0;
  text-align: center;
}
.lbd-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  min-height: 48px;
  font-size: .875rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid #e0e0e0;
  background: #fff;
  color: #444;
  text-align: left;
  max-width: 100%;
  text-transform: uppercase;
}
.lbd-fav-btn .icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.lbd-fav-btn--add {
  color: #555;
  border-color: #ddd;
}
.lbd-fav-btn--add .icon { color: #bbb; }
.lbd-fav-btn--del {
  color: #b8860b;
  border-color: #FFD700;
  background: #fffde6;
}
@media (hover: hover) {
  .lbd-fav-btn:hover {
    border-color: #FFD700;
    background: #fffde6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }
  .lbd-fav-btn:hover .icon { color: #FFD700; }
}
.lbd-fav-btn:active { transform: scale(.97); }
/* Старый .lbd-to-fav — скрываем если остался */
.lbd-to-fav { display: none; }

/* =====================================================
   TAGS (теги на полной странице)
   ===================================================== */
.lbd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.lbd-tag, .lbd-tag-link {
  background: #E67E22;
  color: #fff;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: .8125rem;
  display: inline-block;
  line-height: 1.4;
}
.lbd-tag-link a { color: #fff !important; }
.lbd-tag-link a:hover { color: #fff !important; }
.lbd-tag-link:hover { background: #CF6E17; }
.lbd-tag a { color: #fff !important; }
.lbd-tag a:hover { color: #fff !important; }
.lbd-tag:hover { background: #CF6E17; }
.lbd-story-tag {
  display: inline-block;
  padding: 6px 12px;
  margin: 3px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: .8125rem;
}

/* =====================================================
   RELATED NEWS (внутри fullstory)
   ===================================================== */
.lbd-article .lbd-grid, .lbd-page .lbd-grid, .title_spoiler .lbd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.lbd-article .lbd-grid > br, .lbd-page .lbd-grid > br, .title_spoiler .lbd-grid > br { display: none; }
.lbd-article .lbd-grid > :not(.lbd-card):not([style]):not(br),
.lbd-page .lbd-grid > :not(.lbd-card):not([style]):not(br),
.title_spoiler .lbd-grid > :not(.lbd-card):not([style]):not(br) { grid-column: 1 / -1; }
.lbd-article .lbd-grid > div[style],
.lbd-page .lbd-grid > div[style],
.title_spoiler .lbd-grid > div[style] {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  grid-column: 1 / -1;
}

/* =====================================================
   COMMENTS
   ===================================================== */
.lbd-comment {
  padding: 12px 0 12px 56px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
}
.lbd-comment-ava {
  width: 44px; height: 44px;
  position: absolute;
  left: 0; top: 12px;
  border-radius: 50%;
  overflow: hidden;
}
.lbd-comment-body { width: 100%; }
.lbd-comment-head { padding-bottom: 8px; }
.lbd-comment-head > span { display: inline-block; margin-right: 12px; font-size: .8125rem; opacity: .7; }
.lbd-comment-author { font-weight: 600; opacity: 1 !important; }
.lbd-comment-author a { text-decoration: underline; }
.lbd-comment-text { font-size: .9375rem; line-height: 1.6; }
.lbd-comment-actions { font-size: .75rem; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.lbd-comment-actions li { display: inline-block; }

/* Comment rating */
.lbd-comment-rate { white-space: nowrap; font-weight: 500; margin-top: 4px; }
.lbd-comment-rate a {
  cursor: pointer;
  width: 28px; height: 28px;
  line-height: 28px;
  display: inline-block;
  font-size: 12px;
  text-align: center;
  border-radius: 50%;
  color: #fff;
  vertical-align: middle;
}
.lbd-comment-rate a:first-child { background: #eb6c65; }
.lbd-comment-rate a:last-child { background: #E67E22; }
.lbd-comment-rate > span { padding: 0 6px; }

/* Add comment form */
.add-comm-form { margin-top: 20px; }
.ac-title { font-weight: 600; margin-bottom: 12px; text-transform: uppercase; }
.ac-inputs input { width: 100%; margin-bottom: 12px; }
.ac-textarea textarea { min-height: 120px; }
.ac-protect { margin-top: 8px; }
.registration-form { margin-top: 16px; }
.registration-form__title { font-weight: 600; font-size: 1rem; margin-bottom: 12px; }
.registration-form__field { margin-bottom: 12px; }
.registration-form__submit { width: 100%; }

/* =====================================================
   LOGIN BOX
   ===================================================== */
.lbd-login-box { display: none; background: #fff; padding: 20px; border-radius: 12px; }
.lbd-lb-user { margin: -20px -20px 20px; padding: 16px; background: #f6f6f6; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; border-radius: 12px 12px 0 0; }
.lbd-lb-ava { width: 64px; height: 64px; border-radius: 50%; margin-right: 16px; overflow: hidden; }
.lbd-lb-name div { font-size: 1.125rem; font-weight: 600; }
.lbd-lb-menu a {
  display: block;
  padding: 10px 16px;
  min-height: 44px;
  line-height: 24px;
  background: #f6f6f6;
  margin-bottom: 2px;
  border-radius: 6px;
}
@media (hover: hover) {
  .lbd-lb-menu a:hover { background: #ffdb4c; color: #000; }
}
.lbd-login-box input[type="text"],
.lbd-login-box input[type="password"],
.lbd-login-box button {
  display: block;
  margin-bottom: 12px;
  width: 100%;
}
.lbd-lb-check { margin-bottom: 12px; }
.lbd-lb-check input { display: none; }
.lbd-lb-check input + label::before {
  width: 18px; height: 18px;
  margin-right: 8px;
  cursor: pointer;
  position: relative;
  top: 4px;
  border-radius: 4px;
  border: 1px solid #ccc;
  content: "";
  background: #f6f6f6;
  display: inline-block;
}
.lbd-lb-check input:checked + label::before { background: #E67E22; }
.lbd-lb-soc { margin: 16px -20px -20px; padding: 16px; background: #f6f6f6; text-align: center; border-radius: 0 0 12px 12px; }
.lbd-lb-soc a { display: inline-block; margin: 4px; }
.lbd-lb-soc img { width: 36px; }
.lbd-login-social a { display: inline-block; margin: 0 4px; }
.lbd-login-social img { width: 36px; }

/* =====================================================
   NAVIGATION / PAGINATION
   ===================================================== */
.lbd-pager { text-align: center; padding: 20px 0; }
.lbd-pagi { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.navigation { text-align: center; }
.navigation a, .navigation span,
.pnext a, .pprev a, .pprev > span, .pnext > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  font-size: .875rem;
}
.navigation span { background: #E67E22; color: #fff; }
.navigation span.nav_ext { background: #fff; color: #888; }
@media (hover: hover) {
  .navigation a:hover, .lbd-pagi a:hover { background: #E67E22; color: #fff; }
}
.lbd-load { text-align: center; }
.lbd-load > span { display: none; }

/* =====================================================
   RATING
   ===================================================== */
.lbd-rating {
  width: 100%;
  max-width: 360px;
  margin: 20px auto;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  opacity: 0;
  transition: opacity .3s;
}
.lbd-rating.done { opacity: 1; }
.rate-data { display: none; }
.rate-plus, .rate-minus {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: 24px;
  font-weight: 600;
  font-size: .9375rem;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.rate-plus {
  background: rgba(60,204,0,.1);
  color: #2d8a0e;
}
.rate-minus {
  background: rgba(242,4,4,.1);
  color: #c0392b;
}
.lbd-rating .fa {
  font-size: 20px;
}
.rate-plus .fa { color: #2d8a0e; }
.rate-minus .fa { color: #c0392b; }
.rate-plus .rcount, .rate-minus .rcount {
  font-size: 1rem;
  font-weight: 700;
}
@media (hover: hover) {
  .rate-plus:hover { background: rgba(60,204,0,.2); transform: scale(1.05); }
  .rate-minus:hover { background: rgba(242,4,4,.2); transform: scale(1.05); }
}
.rate-plus:active, .rate-minus:active { transform: scale(.95); }
.rate-perc {
  font-size: 1.5rem;
  font-weight: 800;
  min-width: 60px;
  text-align: center;
}
.rate-perc.high { color: #2d8a0e; }
.rate-perc.low { color: #c0392b; }
.rbar {
  width: 100%;
  height: 8px;
  background: #e74c3c;
  border-radius: 4px;
  overflow: hidden;
  order: 10;
}
.rfill {
  height: 100%;
  background: linear-gradient(90deg, #27ae60, #2ecc71);
  border-radius: 4px;
  transition: width .8s ease;
  width: 50%;
}

/* =====================================================
   DOWNLOAD BUTTONS
   ===================================================== */
.inner-entry__download-header { color: #32c24d; margin: 24px 0 16px; text-align: center; font-weight: 600; }
.download-buttons { padding: 0 8px; }
.download-torrent {
  color: #fff;
  display: block;
  max-width: 600px;
  margin: 8px auto 0;
  background: #32c24d;
  padding: 14px 14px 14px 64px;
  border-radius: 8px;
  min-height: 48px;
}
.download-torrent__name { display: block; font-weight: 700; line-height: 1.3; text-transform: uppercase; }
.download-torrent__size { font-size: .875rem; margin-top: 4px; }

/* =====================================================
   FOOTER
   ===================================================== */
.lbd-footer {
  padding: 20px 12px;
  background: #2a2a2a;
  color: #b0b0b0;
  font-size: .875rem;
  line-height: 1.6;
}
.lbd-footer__inner { display: flex; flex-direction: column; gap: 12px; }
.lbd-footer__left a { color: #E67E22; text-decoration: underline; margin-right: 8px; }
.lbd-footer__left p { margin-top: 8px; }

/* =====================================================
   SCROLL TO TOP
   ===================================================== */
#gotop {
  position: fixed;
  right: 12px; bottom: 12px;
  width: 48px; height: 48px;
  display: none;
  line-height: 48px;
  text-align: center;
  font-size: 20px;
  background: #fff;
  color: #333;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  cursor: pointer;
  z-index: 999;
  -webkit-tap-highlight-color: transparent;
}

/* =====================================================
   USER INFO / PROFILE
   ===================================================== */
.user-popup { padding: 16px 0; }
.upop-left, .upop-right { width: 100%; }
.upop-left { text-align: center; margin-bottom: 16px; }
.up-img { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 8px; overflow: hidden; }
.us-prof { margin-bottom: 16px; }
.usp-left { width: 100%; padding: 16px; text-align: center; }
.usp-right { width: 100%; padding: 16px; }
.usp-av { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto; overflow: hidden; }
.usp-name { padding: 16px; border-bottom: 1px solid #eee; margin-bottom: 8px; }
.usp-name h1 { font-size: 1.125rem; }
.usp-meta li { padding: 8px 12px; }
.usp-meta li:nth-child(2n+1) { background: #f8f8f8; }
.usp-meta li a { text-decoration: underline; }
.online, .offline { padding: 4px 8px; border-radius: 4px; color: #fff; }
.online { background: #4caf50; }
.offline { background: #999; }

/* =====================================================
   MISC / LEGACY
   ===================================================== */
.pm-page, .search-page, .static-page, .tags-page, .form-wrap, .full-pages { padding: 16px 0; }
.sub-title h1 { margin-bottom: 12px; font-size: 1.125rem; }
.tech span { position: relative; padding: 10px 0 10px 16px; display: block; border-bottom: 1px dashed #ccc; }
.tech span::before { content: ""; background: #E67E22; width: 6px; height: 6px; border-radius: 50%; position: absolute; left: 0; top: 14px; }
.sysinfo { background: #f2f6f8; padding: 16px; border-radius: 8px; margin: 12px 0; }
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #f0f0f0; padding: 12px; border-radius: 8px; margin: 12px 0; }
.attach .download-link { color: #fff !important; text-decoration: none !important; padding: 8px 16px; background: #1cbc9a; border-radius: 6px; min-height: 44px; display: flex; align-items: center; }

.ui-dialog {
  width: 90% !important;
  max-width: 360px !important;
  border-radius: 12px !important;
  overflow: visible;
  z-index: 10001 !important;
}
/* Фикс позиционирования на мобильных */
.ui-dialog {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  margin-left: -45% !important;
  margin-top: -200px;
}
@media screen and (min-width: 400px) {
  .ui-dialog {
    margin-left: -180px !important;
  }
}
/* Кнопка закрытия — увеличиваем зону тапа */
.ui-dialog .ui-dialog-titlebar {
  position: relative;
}
/* Родительский элемент close-кнопки (a или button) */
.ui-dialog-titlebar a,
.ui-dialog-titlebar button.ui-dialog-titlebar-close {
  position: absolute !important;
  right: 4px !important;
  top: 50% !important;
  margin-top: -22px !important;
  width: 44px !important;
  height: 44px !important;
  display: block !important;
  cursor: pointer;
  z-index: 100;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin-right: 0 !important;
  overflow: visible !important;
  text-indent: -9999px !important;
  font-size: 0 !important;
}
.ui-dialog-title + a,
.ui-dialog-title ~ button {
  text-indent: -9999px !important;
  font-size: 0 !important;
  color: transparent !important;
}
/* Скрываем текст CLOSE, оставляем только X через :before */
.ui-dialog-titlebar .ui-dialog-titlebar-close span:not(.ui-icon-closethick) {
  display: none !important;
}
.ui-icon-closethick {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  width: 44px !important;
  height: 44px !important;
  cursor: pointer;
  z-index: 101;
  pointer-events: auto;
}
.ui-icon-closethick::before {
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 24px !important;
  text-indent: 0 !important;
}
/* Оверлей — кликабельный для закрытия */
.ui-widget-overlay {
  z-index: 10000 !important;
  cursor: pointer;
}

/* YouTube lazy embed */
.youtube, .youtubes {
  position: relative;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  margin: 16px 0;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}
.youtube .play, .youtubes .play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 69px; height: 50px;
}

/* Related / Recommends */
.rels { margin-bottom: 16px; overflow: hidden; }
.rels-t { font-weight: 600; margin-bottom: 12px; padding: 10px 16px; background: #ffeb9d; border-radius: 6px; }

/* Full page - fullstory local overrides */
.lbd-article .lbd-card, .title_spoiler .lbd-card {
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.lbd-article .lbd-card .lbd-card-name,
.title_spoiler .lbd-card .lbd-card-name {
  font-size: .75rem;
  min-height: 32px;
  padding: 6px 4px;
}

/* asideNav (категории — override engine2.css float layout) */
.asideNav {
  float: none !important;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 16px;
  width: 100%;
}
.asideNav li {
  float: none !important;
  display: block !important;
  width: 100% !important;
  margin-right: 0 !important;
}
.asideNav li a {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  min-height: 44px;
  font-size: .9375rem;
  line-height: 1.4;
  border-bottom: 1px solid #f0f0f0;
  text-transform: capitalize;
  color: #333;
}
.asideNav li a::before {
  content: '\f0da';
  font-family: 'fontawesome';
  color: #E67E22;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
@media (hover: hover) {
  .asideNav li a:hover {
    background: #E67E22;
    color: #fff;
    padding-left: 16px;
  }
  .asideNav li a:hover::before { color: #fff; }
}
/* Два столбца только в основном контенте (не в сайдбаре) */
/* Mobile: fav button full width, tags row only wraps */
@media screen and (max-width: 599px) {
  .lbd-fav-btn { width: 100%; justify-content: center; text-align: center; }
  .lbd-meta__row { flex-wrap: wrap; }
  .lbd-meta__row dt { min-width: 110px; font-size: .8125rem; }
  .lbd-meta__row dd { min-width: 0; overflow-wrap: break-word; word-break: break-word; }
  .lbd-meta__row:last-child dd { width: 100%; }
}

@media screen and (min-width: 600px) {
  .lbd-main .asideNav {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* В мобильном drawer — всегда один столбец */
.lbd-drawer__cats .asideNav {
  grid-template-columns: 1fr !important;
}
.lbd-drawer__cats .asideNav li a {
  border-bottom: 1px solid #f0f0f0;
}
/* Для profile login list — всегда один столбец */
.asideNav.vrs2 {
  grid-template-columns: 1fr !important;
}
.asideNav.vrs2 li {
  width: 100% !important;
}

/* Magnific-popup fix for mobile */
.mfp-wrap { -webkit-overflow-scrolling: touch; }
.mfp-img { max-height: 90vh !important; }

/* Disable body scroll when drawer open */
body.drawer-open { overflow: hidden; }

/* =====================================================
   MEDIA: SM (600px+)
   ===================================================== */
@media screen and (min-width: 600px) {
  .lbd-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .lbd-article .lbd-grid, .lbd-page .lbd-grid, .title_spoiler .lbd-grid { grid-template-columns: repeat(3, 1fr); }
  .lbd-article .lbd-grid > div[style],
  .lbd-page .lbd-grid > div[style],
  .title_spoiler .lbd-grid > div[style] { grid-template-columns: repeat(3, 1fr); }
  .lbd-card-name { font-size: .8125rem; }
  .lbd-seo img { width: 180px; }
  .lbd-detail { flex-direction: row; align-items: flex-start; }
  .lbd-poster { width: 200px; flex-shrink: 0; margin: 0; }
  .lbd-info { flex: 1; }
}

/* =====================================================
   MEDIA: MD (768px+)
   ===================================================== */
@media screen and (min-width: 768px) {
  body { padding-top: 64px; }
  .lbd-header { height: 64px; }
  .lbd-header__inner { height: 64px; }
  .lbd-logo { width: 150px; }
  .lbd-main { padding: 16px; }
  .lbd-side { padding: 16px; }
  .lbd-title h1 { font-size: 1.5rem; }
  .lbd-comment { padding-left: 72px; }
  .lbd-comment-ava { width: 56px; height: 56px; }
  .ac-inputs input { width: 48%; display: inline-block; margin-right: 2%; }
}

/* =====================================================
   MEDIA: LG (960px+) — Sidebar appears, desktop nav
   ===================================================== */
@media screen and (min-width: 960px) {
  /* Show desktop elements */
  .lbd-burger { display: none; }
  .lbd-search {
    display: block;
    flex: 1;
    max-width: 500px;
    margin: 0 16px;
  }
  .lbd-search-box { position: relative; }
  .lbd-search-box input {
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    padding: 0 110px 0 16px;
    background: rgba(255,255,255,.7);
    border-radius: 8px;
  }
  .lbd-search-box button {
    position: absolute;
    right: 0; top: 0;
    width: 100px; height: 40px;
    background: linear-gradient(135deg, #ff934b, #ff5e62);
    color: #fff !important;
    font-size: .75rem;
    border-radius: 0 8px 8px 0;
    min-height: 40px;
    padding: 0;
  }
  .lbd-login-label { display: inline; }
  .lbd-login-btn {
    width: auto;
    padding: 0 16px;
    gap: 8px;
    font-size: .8125rem;
    text-transform: uppercase;
    font-weight: 500;
  }
  .lbd-login-btn .fa { margin-right: 6px; }

  /* Desktop navigation bar */
  .lbd-nav {
    display: block;
    height: 44px;
    line-height: 44px;
    background: #f2f6f8;
    border-bottom: 1px solid #e6e6e6;
  }
  .lbd-nav__inner { display: flex; align-items: center; }
  .lbd-nav__list { display: flex; }
  .lbd-nav__list li a {
    display: block;
    padding: 0 20px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: .875rem;
    color: #333;
    min-height: 44px;
    line-height: 44px;
  }
  .lbd-nav__age {
    margin-left: auto;
    font-weight: 700;
    color: #e84629;
    font-size: .875rem;
  }

  /* Two-column layout */
  .lbd-cols {
    flex-direction: row;
  }
  .lbd-main {
    flex: 1;
    min-width: 0;
    padding: 20px;
    order: initial;
  }
  .lbd-side {
    width: 280px;
    flex-shrink: 0;
    padding: 16px;
    border-top: none;
    border-right: 1px solid #eee;
    order: initial;
    background: #fff;
  }

  .lbd-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* =====================================================
   MEDIA: XL (1220px+) — Full width
   ===================================================== */
@media screen and (min-width: 1220px) {
  .lbd-side { width: 300px; }
  .lbd-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .lbd-article .lbd-grid, .lbd-page .lbd-grid, .title_spoiler .lbd-grid { grid-template-columns: repeat(4, 1fr); }
  .lbd-article .lbd-grid > div[style],
  .lbd-page .lbd-grid > div[style],
  .title_spoiler .lbd-grid > div[style] { grid-template-columns: repeat(4, 1fr); }
  .lbd-search { max-width: 600px; }
  .lbd-nav__list li a { padding: 0 28px; }
}

/* =====================================================
   SAFE AREA (для iPhone X+ с вырезом)
   ===================================================== */
@supports (padding: env(safe-area-inset-bottom)) {
  .lbd-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  #gotop { bottom: calc(12px + env(safe-area-inset-bottom)); }
}
.grecaptcha-badge { visibility: hidden; }

/* =====================================================
   TOP xfields grid (artauthor, parody, studio)
   ===================================================== */
.top-xf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 16px 0;
}
.top-xf-col {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #eee;
}
.top-xf-col__title {
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 0;
  margin-bottom: 4px;
  color: #555;
  border-bottom: 2px solid #E67E22;
}
.top-xf__list { list-style: none; margin: 0; padding: 0; }
.top-xf__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  height: 40px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  transition: background .15s;
}
.top-xf__item:last-child { border-bottom: none; }
@media (hover: hover) {
  .top-xf__item:hover { background: rgba(0,0,0,.03); border-radius: 6px; }
}
.top-xf__pos {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: .7rem;
  flex-shrink: 0;
  background: #e0e0e0;
  color: #666;
}
.top-xf__item:nth-child(1) .top-xf__pos { background: #FFD700; color: #fff; }
.top-xf__item:nth-child(2) .top-xf__pos { background: #C0C0C0; color: #fff; }
.top-xf__item:nth-child(3) .top-xf__pos { background: #CD7F32; color: #fff; }
.top-xf__link {
  flex: 1;
  font-size: .8125rem;
  font-weight: 500;
  color: #333 !important;
  text-decoration: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (hover: hover) {
  .top-xf__link:hover { color: #E67E22 !important; }
}

@media screen and (min-width: 600px) {
  .top-xf-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =====================================================
   SORT BAR — styled pills
   ===================================================== */
.lbd-sort b { font-weight: 600; margin-right: 4px; }
ul.sort { display: flex !important; flex-wrap: wrap; gap: 6px; float: none !important; padding: 0; margin: 0; }
ul.sort li {
  display: inline-flex !important;
  align-items: center;
  float: none !important;
  margin: 0 !important;
}
ul.sort li a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  min-height: 36px;
  font-size: .8125rem;
  font-weight: 500;
  color: #555;
  background: #f0f0f0;
  border-radius: 20px;
  text-decoration: none !important;
  transition: all .15s;
  white-space: nowrap;
}
ul.sort li a:hover {
  background: #E67E22;
  color: #fff !important;
}
ul.sort li.asc a,
ul.sort li.desc a {
  background: #E67E22;
  color: #fff !important;
  font-weight: 600;
}
ul.sort li.asc a::after { content: ' ▼'; font-size: .875rem; margin-left: 2px; }
ul.sort li.desc a::after { content: ' ▲'; font-size: .875rem; margin-left: 2px; }

/* Related news + title_spoiler links */
.title_spoiler a,
.lbd-text .short a,
.lbd-text .short-title,
a.short-title {
  color: #333 !important;
  text-decoration: none !important;
}
.title_spoiler a:hover,
.lbd-text .short a:hover,
.lbd-text .short-title:hover,
a.short-title:hover {
  color: #E67E22 !important;
}

/* Footer contrast fix */
.lbd-footer { background: #222; color: #ccc; }
.lbd-footer a { color: #fff !important; text-decoration: underline; }
.lbd-footer p { color: #aaa; }

/* Vote widget */
.vote-widget { padding: 12px; }
.vote-widget__title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.vote-more { margin-bottom: 12px; }
.vote-more a { font-size: .8125rem; color: #E67E22; text-decoration: none; }
.vote-list { margin-bottom: 12px; }
.vote-list label { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: .875rem; cursor: pointer; }
.vote-votes { font-size: .8125rem; color: #888; margin-bottom: 12px; }
.vote-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.vote-buttons .btn { padding: 8px 16px; border-radius: 6px; font-size: .8125rem; font-weight: 600; cursor: pointer; min-height: 36px; }
.vote-buttons .btn-white { background: #E67E22; color: #fff; }
.vote-buttons .btn-border { background: #f0f0f0; color: #555; }
