/* assets/css/book.css — Библиотека, Помощь, Контакты, Правила, Согласие.
   Рамка и разделы слева — как в «Журнале заданий» (quests_book.html); статья справа — как в новостях (news.css). */
@keyframes stubSlideUp { from { opacity: 0; transform: translateY(40px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
:root {
      --bg-dark: #0a0503;
      --gold: #e1b76c;
      --gold-light: #f5d28a;
      --gold-dark: #c9a35e;
      --text: #f0ede8;
      --text-dim: #b8aa8c;
      --text-muted: #6b5f4d;
      --border: #4a3325;
      --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
      --success: #2ecc71;
      --danger: #c0392b;
    }
body { padding: 20px; height: 100dvh; min-height: 0; }
.quest-journal-container {
      width: 100%; max-width: 560px; height: 90vh;
      background: linear-gradient(145deg, rgba(40, 25, 15, 0.98), rgba(25, 15, 8, 0.99));
      border: 2px solid #4a3325; border-radius: 16px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(225, 183, 108, 0.2);
      display: flex; flex-direction: column;
      animation: stubSlideUp 0.5s cubic-bezier(0.23, 1, 0.32, 1);
      overflow: hidden;
    }

    .main-menu-header {
      background: linear-gradient(to bottom, rgba(40, 25, 15, 0.9), rgba(30, 18, 10, 0.95));
      padding: 16px 20px; border-bottom: 1px solid #4a3325;
      display: flex; align-items: center; gap: 14px; flex-shrink: 0;
    }

    .main-menu-portrait {
      width: 48px; height: 48px;
      background: radial-gradient(circle at 30% 30%, rgba(225, 183, 108, 0.15), rgba(0, 0, 0, 0.6) 70%);
      border-radius: 50%; display: flex; align-items: center; justify-content: center;
      border: 2px solid #c9a35e; flex-shrink: 0;
    }
    .main-menu-portrait i { font-size: 22px; color: #e1b76c; }

    .main-menu-title-block { flex: 1; min-width: 0; }
    .main-menu-title-block h2 {
      color: #f5d28a; font-size: 18px; font-family: 'Cinzel', serif;
      font-weight: 700; margin: 0 0 2px; letter-spacing: 0.5px;
    }
    .main-menu-title-block p {
      color: #a99e87; font-size: 11px; text-transform: uppercase;
      letter-spacing: 0.1em; font-weight: 600; margin: 0;
    }

    .main-menu-close-btn {
      width: 32px; height: 32px;
      background: linear-gradient(135deg, rgba(192, 57, 43, 0.12), rgba(139, 26, 26, 0.08));
      border: 1px solid rgba(192, 57, 43, 0.3); border-radius: 50%; color: #e74c3c;
      font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: all 0.2s ease; flex-shrink: 0;
    }
    .main-menu-close-btn:hover { background: rgba(192, 57, 43, 0.2); border-color: #e74c3c; color: #ff6b6b; }

    .quest-content-area {
      flex: 1; display: flex; overflow: hidden;
    }

    .quest-sidebar {
      width: 200px; border-right: 1px solid var(--border);
      display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0;
      background: rgba(0, 0, 0, 0.2);
    }

    .quest-categories {
      overflow-y: auto; flex: 1; padding-bottom: 20px;
      scrollbar-width: none; -ms-overflow-style: none;
    }
    .quest-categories::-webkit-scrollbar { display: none; }

    .category-group { border-bottom: 1px solid rgba(74, 51, 37, 0.5); }

    .category-header {
      padding: 12px 14px; background: rgba(42, 33, 24, 0.6); cursor: pointer;
      display: flex; align-items: center; justify-content: space-between;
      transition: var(--transition-normal); user-select: none;
    }
    .category-header:hover { background: rgba(60, 48, 34, 0.7); }
    .category-header.active { background: rgba(225, 183, 108, 0.15); }

    .category-title {
      display: flex; align-items: center; gap: 8px; font-family: 'Cinzel', serif;
      font-size: 11px; font-weight: 700; color: var(--gold-light);
      text-transform: uppercase; letter-spacing: 0.5px;
    }
    .category-icon {
      width: 22px; height: 22px; background: rgba(225, 183, 108, 0.1);
      border: 1px solid rgba(225, 183, 108, 0.3); border-radius: 4px;
      display: flex; align-items: center; justify-content: center; font-size: 11px;
    }
    .category-count {
      margin-left: auto; background: rgba(0, 0, 0, 0.4); padding: 2px 6px;
      border-radius: 8px; font-size: 10px; font-weight: 700; color: var(--text-dim);
    }

    .quest-list-sidebar {
      max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
    }
    .quest-list-sidebar.expanded { max-height: 400px; }

    .quest-item-sidebar {
      display: flex; justify-content: space-between; align-items: center;
      padding: 10px 12px 10px 36px; cursor: pointer; transition: var(--transition-normal);
      border-left: 2px solid transparent; font-size: 11px; color: var(--text-dim); font-weight: 600;
    }
    .quest-item-sidebar:hover { background: rgba(225, 183, 108, 0.08); color: var(--text); }
    .quest-item-sidebar.active {
      background: rgba(225, 183, 108, 0.06); border-left-color: var(--gold); color: var(--text);
    }
    .quest-details {
      flex: 1; overflow-y: auto; padding: 18px;
      scrollbar-width: none; -ms-overflow-style: none;
    }
    .quest-details::-webkit-scrollbar { display: none; }

    
.quest-journal-container { height: min(90vh, 900px); }
.main-menu-title-block h1 { color: #f5d28a; font-size: 18px; font-family: 'Cinzel', serif; font-weight: 700; margin: 0 0 2px; letter-spacing: .5px; }
a.main-menu-close-btn, .category-header, .quest-item-sidebar { text-decoration: none; }
.category-icon { color: var(--gold); flex-shrink: 0; }
.category-title span { overflow-wrap: anywhere; }
.quest-list-sidebar.expanded { max-height: 1200px; }
.quest-details { padding: 0; overflow-x: hidden; display: flex; flex-direction: column; }

/* одна статья за раз */
.js-book .book-sec { display: none; }
.js-book .book-sec.on { display: flex; }
.book-sec { flex-direction: column; flex: 1 0 auto; }
.book-sec .back { align-self: flex-start; margin: 6px 0 -6px 4px; }
.book-sec .art-head { text-align: center; }
.book-sec .prose:empty { display: none; }
.prose .light { color: #ffe9a8; } .prose .dark { color: #ff9b8f; }
.prose .soon { display: inline-block; font-family: 'Segoe UI', system-ui, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #f5b041; border: 1px solid rgba(245,176,65,.5); border-radius: 4px; padding: 0 5px; vertical-align: 3px; }
.prose .cost { color: var(--gold); font-size: 12.5px; margin-top: -6px; }
.prose figure { text-align: center; }
.prose .race-img { width: 96px; height: 96px; border-radius: 50%; border: 2px solid rgba(225,183,108,.55); display: inline-block; box-shadow: 0 0 18px rgba(225,183,108,.2); }
.q0 { color: #b8b8b8; font-weight: 700; } .q1 { color: #4ade80; font-weight: 700; } .q2 { color: #60a5fa; font-weight: 700; }
.q3 { color: #c084fc; font-weight: 700; } .q4 { color: #fb923c; font-weight: 700; } .q5 { color: #f87171; font-weight: 700; }

/* карточки подразделов — как карточки новостей */
.cards-list { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 14px; }
.cards-list .card { display: block; text-decoration: none; }

/* помощник — на всю высоту */
.sec-bot.on { flex: 1 1 auto; min-height: 0; }
.bot { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0 12px 12px; border: 1px solid #3a3226; border-radius: 8px; background: rgba(0,0,0,.28); overflow: hidden; }
.bot-log { flex: 1; min-height: 160px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 9px; scrollbar-width: none; }
.bot-log::-webkit-scrollbar { display: none; }
.bot-msg { max-width: 88%; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.6; }
.bot-msg.me { align-self: flex-end; background: rgba(225,183,108,.16); border: 1px solid rgba(225,183,108,.35); color: #f6e7c6; }
.bot-msg.it { align-self: flex-start; background: linear-gradient(180deg, #23262f, #1c1f26); border: 1px solid #2a2e37; color: #d8d2c4; }
.bot-msg.it b { color: var(--gold-bright, #ffd88a); font-family: 'Forum', serif; font-size: 15px; font-weight: 400; }
.bot-msg a { color: #ffd88a; }
.bot-msg .sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bot-msg .sugg button { font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 20px; border: 1px solid #3a3226; background: rgba(0,0,0,.3); color: #b8aa8c; cursor: pointer; }
.bot-msg .sugg button:hover { color: #f0ede8; border-color: #a8874a; }
.bot-msg .sugg button i { margin-right: 6px; color: var(--gold, #e1b76c); font-size: 10px; }
.bot-msg .sugg button.nav { color: #e1b76c; border-color: rgba(225,183,108,.45); }
.bot-msg .sugg.list { flex-direction: column; flex-wrap: nowrap; }
.bot-msg .sugg.list button { border-radius: 8px; text-align: left; font-size: 12px; line-height: 1.35; padding: 7px 11px; }
.bot-msg .sugg.list button.nav { align-self: flex-start; border-radius: 20px; }
.bot-in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #2a2e37; background: linear-gradient(180deg, rgba(22,24,29,.92), #16181d); }
.bot-in input { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 6px; border: 1px solid #3a3226; background: rgba(0,0,0,.4); color: #f0e6d2; font: 13px 'Segoe UI', system-ui, sans-serif; outline: none; }
.bot-in input:focus { border-color: #a8874a; }

/* обращение — на всю высоту */
.sec-ask.on { flex: 1 1 auto; }
.ask-form { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 0 14px 14px; }
.fld-grow { flex: 1; display: flex; flex-direction: column; }
.fld-grow textarea { flex: 1; min-height: 140px; }
.fld label .count { float: right; font-weight: 400; text-transform: none; letter-spacing: 0; color: #8b7a58; }
.btn.wide { width: 100%; padding: 11px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-msg { font-size: 13px; padding: 8px 10px; border-radius: 6px; display: none; }
.form-msg.ok { display: block; color: #7bedb0; background: rgba(46,204,113,.1); border: 1px solid rgba(46,204,113,.4); }
.form-msg.bad { display: block; color: #ff9b8f; background: rgba(231,76,60,.1); border: 1px solid rgba(231,76,60,.4); }

/* мои обращения — карточки */
.tickets { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 14px; }
.ticket { padding: 11px 13px; }
.ticket .t-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #8b7a58; margin-bottom: 6px; }
.ticket .t-st { font-weight: 700; } .t-st.open { color: #f5b041; } .t-st.answered { color: #7bedb0; } .t-st.closed { color: #8b7a58; }
.ticket .t-text { font-size: 13px; line-height: 1.6; color: #d8d2c4; white-space: pre-wrap; word-break: break-word; }
.ticket .t-reply { margin-top: 8px; padding: 8px 10px; border-left: 3px solid #e1b76c; border-radius: 0 6px 6px 0; background: rgba(225,183,108,.06); font-size: 13px; color: #e8dcc0; white-space: pre-wrap; }
[hidden] { display: none !important; }

@media (max-width: 767px) {
  body { padding: 12px; }
  .quest-journal-container { max-width: 100%; height: calc(100dvh - 24px); }
  .main-menu-header { padding: 12px 14px; gap: 10px; }
  .main-menu-portrait { width: 36px; height: 36px; }
  .main-menu-portrait i { font-size: 18px; }
  .main-menu-title-block h1 { font-size: 15px; }
  .main-menu-title-block p { font-size: 10px; }
  .main-menu-close-btn { width: 28px; height: 28px; font-size: 12px; }
  .quest-sidebar { width: 128px; }
  .category-header { padding: 10px 8px; }
  .category-title { font-size: 9.5px; gap: 6px; }
  .category-icon { width: 18px; height: 18px; font-size: 10px; }
  .quest-item-sidebar { padding: 9px 8px 9px 30px; font-size: 10px; }
  .art-head { padding: 12px 10px 8px; }
  .art-title { font-size: 19px; }
  .prose { padding: 2px 12px 14px; font-size: 13px; line-height: 1.65; }
  .prose h3 { font-size: 16px; }
  .cards-list, .tickets { padding: 0 8px 12px; }
  .card-title { font-size: 15px; }
  .bot { margin: 0 8px 8px; }
  .ask-form { padding: 0 10px 12px; }
}

/* ══ цвета как в новостях: тёмно-синие панели вместо коричневых ══ */
.quest-journal-container {
  background: linear-gradient(180deg, #1c1f26 0%, #16181d 100%);
  border-color: #2a2e37;
  box-shadow: 0 20px 60px rgba(0,0,0,.9), 0 0 0 1px rgba(225,183,108,.15);
}
.main-menu-header {
  background: linear-gradient(180deg, #23262f 0%, #1c1f26 30%, #16181d 100%);
  border-bottom: 1px solid #2a2e37;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.quest-sidebar { background: #14161b; border-right-color: #2a2e37; }
.category-group { border-bottom-color: #23262e; }
.category-header { background: linear-gradient(180deg, #1f2229 0%, #1a1c22 100%); }
.category-header:hover { background: linear-gradient(180deg, #262a33 0%, #1f2229 100%); }
.category-header.active { background: linear-gradient(180deg, rgba(225,183,108,.16), rgba(225,183,108,.08)); }
.category-icon { background: rgba(0,0,0,.35); border-color: rgba(225,183,108,.35); }
.category-count { background: rgba(0,0,0,.45); }
.quest-list-sidebar { background: #16181d; }
.quest-item-sidebar:hover { background: rgba(225,183,108,.06); }
.quest-details { background: linear-gradient(180deg, #1c1f26 0%, #16181d 100%); }
.bot { border-color: #2a2e37; background: rgba(0,0,0,.25); }

/* ★ телефон: разделы слева не помещаются — список прокручивается, внизу подсказка «есть ещё» (затемнение и стрелка) */
.quest-categories::after { content: '\f107'; font: 900 13px 'Font Awesome 6 Free'; position: sticky; bottom: 0; display: block; height: 30px; margin-top: -30px;
  line-height: 38px; text-align: center; color: rgba(255,216,138,.75); pointer-events: none;
  background: linear-gradient(180deg, rgba(20,22,27,0), #14161b 75%); }
@media (max-width: 767px) and (max-height: 720px) {
  .category-header { padding-top: 8px; padding-bottom: 8px; }
}
