/* stories.css — истории игроков: /stories, /stories/{ник}, /my-story */
body { display: block; }
#main-header { position: sticky; }

.st-wrap { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }
.st-wrap.narrow { max-width: 820px; }
.st-title { font-family: 'Cinzel', serif; font-size: 1.9rem; color: var(--primary-gold);
    display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.st-subtitle { color: #8b91a8; font-size: .95rem; margin-bottom: 1.6rem; max-width: 720px; line-height: 1.6; }
.st-breadcrumb { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .8rem; color: #45475a; margin-bottom: 1.4rem; }
.st-breadcrumb a { color: #6c7086; text-decoration: none; transition: color .2s; }
.st-breadcrumb a:hover { color: var(--primary-gold); }
.st-breadcrumb i { font-size: .65rem; }

.st-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.1rem; border-radius: 10px; cursor: pointer;
    font-size: .88rem; font-weight: 600; text-decoration: none; color: #cdd6f4; font-family: inherit;
    background: rgba(203,166,247,.14); border: 1px solid rgba(203,166,247,.3); transition: background .2s, border-color .2s; }
.st-btn:hover { background: rgba(203,166,247,.24); }
.st-btn.gold { background: rgba(212,175,55,.16); border-color: rgba(212,175,55,.5); color: var(--primary-gold); }
.st-btn.gold:hover { background: rgba(212,175,55,.26); }
.st-btn.danger { background: rgba(243,139,168,.1); border-color: rgba(243,139,168,.35); color: #f38ba8; }
.st-btn:disabled { opacity: .55; cursor: not-allowed; }

.st-note { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 12px; margin-bottom: 1.4rem;
    font-size: .88rem; line-height: 1.55; color: #cdd6f4; background: rgba(137,220,235,.08); border: 1px solid rgba(137,220,235,.25); }
.st-note i { margin-top: .2rem; color: #89dceb; }
.st-note.warn { background: rgba(249,226,175,.08); border-color: rgba(249,226,175,.3); }
.st-note.warn i { color: #f9e2af; }
.st-note.bad { background: rgba(243,139,168,.08); border-color: rgba(243,139,168,.3); }
.st-note.bad i { color: #f38ba8; }
.st-note.good { background: rgba(166,227,161,.08); border-color: rgba(166,227,161,.3); }
.st-note.good i { color: #a6e3a1; }

/* ── Список ── */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.3rem; }
.st-card { display: flex; flex-direction: column; gap: .7rem; padding: 1.2rem 1.3rem; text-decoration: none; color: inherit;
    background: rgba(26,42,58,.55); border: 1px solid rgba(212,175,55,.16); border-radius: 16px;
    transition: border-color .25s, transform .25s, box-shadow .25s; }
.st-card:hover { border-color: rgba(212,175,55,.5); transform: translateY(-4px); box-shadow: 0 14px 32px rgba(0,0,0,.45); }
.st-card-cover { margin: -1.2rem -1.3rem .2rem; aspect-ratio: 16/8; overflow: hidden; border-radius: 16px 16px 0 0; background: rgba(17,17,27,.6); }
.st-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-card-author { display: flex; align-items: center; gap: .65rem; font-size: .82rem; color: #a6adc8; }
.st-card-author img { width: 36px; height: 36px; border-radius: 8px; }
.st-card-name { font-family: 'Cinzel', serif; font-size: 1.08rem; font-weight: 700; color: #cdd6f4; line-height: 1.35; }
.st-card:hover .st-card-name { color: #fff; }
.st-card-excerpt { font-size: .86rem; color: #8b91a8; line-height: 1.55; flex: 1; }
.st-card-date { font-size: .76rem; color: #6c7086; }
.st-empty { text-align: center; color: #6c7086; padding: 4rem 1rem; }
.st-empty i { font-size: 2.6rem; display: block; margin-bottom: 1rem; color: rgba(212,175,55,.2); }
.st-pagination { display: flex; justify-content: center; gap: .5rem; margin-top: 2.2rem; flex-wrap: wrap; }
.st-pagination a, .st-pagination span { min-width: 38px; height: 38px; padding: 0 .6rem; border-radius: 10px; display: inline-flex;
    align-items: center; justify-content: center; text-decoration: none; font-size: .9rem; color: #a6adc8;
    background: rgba(26,42,58,.55); border: 1px solid rgba(212,175,55,.18); transition: .2s; }
.st-pagination a:hover { border-color: rgba(212,175,55,.45); color: var(--primary-gold); }
.st-pagination .active { background: rgba(212,175,55,.16); border-color: rgba(212,175,55,.5); color: var(--primary-gold); }

/* ── Страница истории ── */
h1.st-story-title { font-family: 'Cinzel', serif; font-size: 2.1rem; line-height: 1.25; margin-bottom: 1rem; color: var(--primary-gold); }
.st-story-meta { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: 2rem; padding-bottom: 1.3rem;
    border-bottom: 1px solid rgba(255,255,255,.07); font-size: .84rem; color: #6c7086; }
.st-story-meta a.author { display: inline-flex; align-items: center; gap: .55rem; color: #cba6f7; text-decoration: none; font-weight: 600; font-size: .95rem; }
.st-story-meta img { width: 40px; height: 40px; border-radius: 9px; }
.st-like-btn { display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 .9rem; border-radius: 10px; cursor: pointer;
    font-size: .88rem; font-weight: 600; color: #a6adc8; font-family: inherit;
    background: rgba(26,42,58,.55); border: 1px solid rgba(212,175,55,.18); transition: .2s; }
.st-like-btn:hover { border-color: rgba(243,139,168,.45); color: #f38ba8; }
.st-like-btn.liked { color: #f38ba8; border-color: rgba(243,139,168,.5); background: rgba(243,139,168,.1); }
.st-story-meta .share { margin-left: auto; display: flex; gap: .5rem; }
.st-story-meta .share a, .st-story-meta .share button { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(26,42,58,.55); border: 1px solid rgba(212,175,55,.18); color: #a6adc8; text-decoration: none; transition: .2s; cursor: pointer; font-size: .95rem; padding: 0; }
.st-story-meta .share a:hover, .st-story-meta .share button:hover { color: var(--primary-gold); border-color: rgba(212,175,55,.45); }

/* Тело истории — один и тот же вид на странице и в предпросмотре редактора */
.story-body { color: #cdd6f4; font-size: 1.03rem; line-height: 1.78; overflow-wrap: break-word; word-break: normal; }
.story-body p { margin: 0 0 1.1rem; }
.story-body h3 { font-family: 'Cinzel', serif; font-size: 1.3rem; color: var(--primary-gold); margin: 2rem 0 .7rem; }
.story-body blockquote { margin: 0 0 1.1rem; padding: .6rem 1rem; border-left: 3px solid #cba6f7; background: rgba(203,166,247,.07);
    border-radius: 0 10px 10px 0; color: #bac2de; }
.story-body ul { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.story-body li { margin: .25rem 0; }
.story-body figure { margin: 1.6rem 0; text-align: center; }
.story-body figure img { max-width: 100%; max-height: 560px; border-radius: 12px; border: 1px solid rgba(212,175,55,.2); cursor: zoom-in; }
.story-body figcaption { margin-top: .5rem; font-size: .84rem; color: #8b91a8; font-style: italic; }
.story-body a.story-mention { color: #cba6f7; text-decoration: none; font-weight: 600; background: rgba(203,166,247,.12);
    border-radius: 6px; padding: 0 .3rem; transition: background .15s; }
.story-body a.story-mention:hover { background: rgba(203,166,247,.25); }

/* ── Редактор ── */
.st-field-label { display: block; font-size: .82rem; color: #a6adc8; margin: 1.1rem 0 .4rem; }
.st-input, .st-textarea { width: 100%; box-sizing: border-box; background: rgba(17,17,27,.6); border: 1px solid rgba(203,166,247,.25);
    border-radius: 10px; color: #cdd6f4; font-family: 'Roboto', sans-serif; font-size: .95rem; padding: .7rem .9rem; outline: none; }
.st-input:focus, .st-textarea:focus { border-color: rgba(212,175,55,.55); }
.st-textarea { min-height: 380px; resize: vertical; line-height: 1.6; }
.st-toolbar { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.st-tool { min-width: 36px; height: 34px; padding: 0 .65rem; border-radius: 8px; cursor: pointer; font-size: .85rem; color: #cdd6f4;
    background: rgba(203,166,247,.1); border: 1px solid rgba(203,166,247,.25); font-family: inherit; }
.st-tool:hover { background: rgba(203,166,247,.22); }
.st-edit-area { position: relative; }
.st-suggest { position: absolute; left: 0; right: 0; bottom: -4px; transform: translateY(100%); z-index: 20; display: none; max-height: 220px; overflow-y: auto;
    background: #1e1e2e; border: 1px solid rgba(203,166,247,.35); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.st-suggest.open { display: block; }
.st-suggest div { padding: .5rem .9rem; cursor: pointer; font-size: .9rem; color: #cdd6f4; }
.st-suggest div.on, .st-suggest div:hover { background: rgba(203,166,247,.2); }
.st-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; }
.st-count { font-size: .78rem; color: #6c7086; }
.st-preview-box { margin-top: 1.6rem; padding: 1.3rem 1.5rem; background: rgba(26,42,58,.45); border: 1px dashed rgba(212,175,55,.3); border-radius: 14px; }
.st-preview-box h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #6c7086; margin: 0 0 1rem; }
.st-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.st-textarea.short { min-height: 90px; }

/* ── Правила публикации ── */
.st-accept { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1.4rem; font-size: .88rem; line-height: 1.5; color: #cdd6f4; cursor: pointer; }
.st-accept input { margin-top: .25rem; flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--primary-gold); }
.st-accept a { color: #cba6f7; }
.st-rules { margin-top: 1.6rem; padding-top: .8rem; border-top: 1px solid rgba(255,255,255,.07); font-size: .78rem; color: #8b91a8; }
.st-rules summary { cursor: pointer; color: #8b91a8; }
.st-rules summary:hover { color: #cdd6f4; }
.st-rules-body { font-size: .82rem; line-height: 1.6; color: #a6adc8; }
.st-rules-body h4 { margin: 1.1rem 0 .4rem; font-size: .88rem; color: #cdd6f4; }
.st-rules-body p { margin: 0 0 .5rem; }
.st-rules-body a { color: #cba6f7; }
.st-rules-body b { color: #bac2de; }
.st-rules[open] { max-height: none; }
.st-rules[open] .st-rules-body { margin-top: .6rem; padding: .3rem 1rem 1rem; background: rgba(26,42,58,.35); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; max-height: 420px; overflow-y: auto; }
.st-wrap > .st-rules-body { font-size: .95rem; }

/* ── Книга: карточка в списке, оглавление, навигация между главами ── */
.st-card-date { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.st-card-chapters { color: #fab387; font-weight: 600; }
.st-book-bar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; font-size: .88rem; }
.st-book-name { color: #cba6f7; text-decoration: none; font-weight: 700; }
.st-book-name:hover { text-decoration: underline; }
.st-book-count { color: #6c7086; font-size: .8rem; }
.st-toc { margin-bottom: 1.6rem; background: rgba(26,42,58,.45); border: 1px solid rgba(212,175,55,.18); border-radius: 12px; padding: .2rem 1rem; }
.st-toc summary { cursor: pointer; padding: .7rem 0; font-size: .9rem; font-weight: 600; color: #cdd6f4; list-style: none; }
.st-toc summary::-webkit-details-marker { display: none; }
.st-toc summary i { color: var(--primary-gold); margin-right: .4rem; }
.st-toc ol { list-style: none; margin: 0 0 .6rem; padding: 0; max-height: 340px; overflow-y: auto; }
.st-toc li { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; padding: .4rem .5rem; border-radius: 8px; }
.st-toc li a { color: #bac2de; text-decoration: none; font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.st-toc li a:hover { color: var(--primary-gold); }
.st-toc li.current { background: rgba(212,175,55,.12); }
.st-toc li.current a { color: var(--primary-gold); font-weight: 700; }
.st-toc-n { display: inline-block; min-width: 1.6rem; color: #6c7086; font-variant-numeric: tabular-nums; }
.st-toc-min { color: #6c7086; font-size: .74rem; white-space: nowrap; }
.st-chapter-eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #fab387; margin-bottom: .5rem; }
.st-chapter-title { font-family: 'Cinzel', serif; font-size: 1.3rem; color: #cdd6f4; margin: 0 0 1rem; }
.st-annotation { font-size: 1.05rem; line-height: 1.7; color: #bac2de; font-style: italic; margin: 0 0 1.6rem; padding: .2rem 0 .2rem 1rem; border-left: 3px solid rgba(212,175,55,.4); }
.st-chapter-nav { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: 2.4rem; }
.st-nav-card { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1.1rem; border-radius: 12px; text-decoration: none; color: inherit;
    background: rgba(26,42,58,.55); border: 1px solid rgba(212,175,55,.2); transition: border-color .2s, transform .2s; min-width: 0; }
.st-nav-card:hover { border-color: rgba(212,175,55,.55); transform: translateY(-2px); }
.st-nav-card.next { text-align: right; background: linear-gradient(135deg, rgba(212,175,55,.14), rgba(26,42,58,.55)); }
.st-nav-dir { font-size: .76rem; color: var(--primary-gold); font-weight: 600; }
.st-nav-title { font-family: 'Cinzel', serif; font-size: .98rem; color: #cdd6f4; overflow-wrap: anywhere; }

/* ── Управление книгой (/my-story) ── */
.st-book-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.st-book-head h2 { font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--primary-gold); margin: 0 0 .3rem; }
.st-ch-list { list-style: none; margin: 0 0 1.2rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.st-ch-item { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .8rem 1rem; border-radius: 12px;
    background: rgba(26,42,58,.5); border: 1px solid rgba(212,175,55,.16); }
.st-ch-n { flex: 0 0 auto; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--primary-gold); background: rgba(212,175,55,.12); }
.st-ch-main { flex: 1 1 220px; min-width: 0; }
.st-ch-title { font-weight: 600; color: #e3e8f5; overflow-wrap: anywhere; }
.st-ch-sub { margin-top: .25rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .76rem; color: #6c7086; }
.st-badge { font-size: .7rem; font-weight: 700; border-radius: 6px; padding: .1rem .5rem; border: 1px solid; white-space: nowrap; }
.st-badge.ok { color: #a6e3a1; border-color: rgba(166,227,161,.45); }
.st-badge.wait { color: #f9e2af; border-color: rgba(249,226,175,.45); }
.st-badge.bad { color: #f38ba8; border-color: rgba(243,139,168,.45); }
.st-ch-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.st-mini { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; height: 32px; min-width: 32px; padding: 0 .65rem; border-radius: 8px; cursor: pointer;
    font-size: .8rem; font-family: inherit; text-decoration: none; color: #cdd6f4; background: rgba(203,166,247,.1); border: 1px solid rgba(203,166,247,.25); }
.st-mini:hover:not(:disabled) { background: rgba(203,166,247,.22); }
.st-mini:disabled { opacity: .35; cursor: not-allowed; }
.st-mini.danger { color: #f38ba8; border-color: rgba(243,139,168,.35); background: rgba(243,139,168,.08); }
.st-ch-reason { flex-basis: 100%; font-size: .8rem; color: #f38ba8; }
.st-editor-nav { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.st-editor-nav select { background: rgba(17,17,27,.6); color: #cdd6f4; border: 1px solid rgba(203,166,247,.25); border-radius: 8px; padding: .4rem .6rem; font-family: inherit; max-width: 100%; }

@media (max-width: 600px) {
    .st-chapter-nav { grid-template-columns: 1fr; }
    .st-nav-card.next { text-align: left; }
    .st-title { font-size: 1.5rem; }
    h1.st-story-title { font-size: 1.6rem; }
    .st-wrap { padding: 1.6rem 1rem 4rem; }
}
