/* RD Lib — «стеклянные конфеты» и хрусталь: тёплый светло-розовый фон с размытыми огоньками
   (розовый, лиловый, персиковый — без холодного голубого, так глазам легче),
   полупрозрачные стеклянные карточки (радужные блики она попросила убрать).
   Тёмная — «ночные конфеты»: тёмно-фиолетовая ночь со светящимися огоньками.
   Страница чтения — спокойная, ровного цвета (её решение). */

:root {
  --bg: #fff5f7;                       /* сплошной цвет фона (и шапки Telegram) — тёплый розовый */
  /* стекло: светлая грань сверху-слева → прозрачнее к низу-справа */
  --card: linear-gradient(135deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, .2) 55%, rgba(255, 255, 255, .12) 100%);
  --card-solid: #ffffff;
  --glass-border: rgba(255, 255, 255, .9);
  --glass-blur: blur(10px) saturate(170%);
  --glass-shadow: 0 10px 30px rgba(140, 110, 200, .18), inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -1px 0 rgba(190, 160, 255, .25);
  /* стеклянная кнопка: полупрозрачный конфетный перелив + блик */
  --glass-btn: linear-gradient(135deg, rgba(255, 175, 210, .5) 0%, rgba(205, 175, 255, .45) 50%, rgba(160, 215, 255, .5) 100%);
  --glass-btn-shadow: 0 8px 22px rgba(170, 120, 220, .28), inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -8px 14px rgba(170, 130, 255, .18), inset 0 0 0 1px rgba(255, 255, 255, .35);
  --text: #2d2540;
  --muted: #6c6185;
  --line: rgba(120, 100, 170, .18);
  --accent: #b2397a;                   /* акцент для текста: ягодно-розовый */
  --accent-text: #2d1a3f;              /* текст на кнопках-конфетах */
  --btn: linear-gradient(135deg, #ffc4dc 0%, #e0cbff 50%, #c2e6ff 100%);
  --btn-shine: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 55%);
  --chip: rgba(255, 255, 255, .7);
  --bokeh-1: rgba(255, 160, 200, .7);
  --bokeh-2: rgba(214, 170, 255, .55);
  --bokeh-3: rgba(255, 196, 176, .65);  /* тёплый персиковый вместо голубого */
  --read-bg: #fff6f5;                  /* спокойная страница чтения — тёплая, не белая */
  color-scheme: light;
}

:root[data-theme="dark"] {
  /* Её просьба: ночью фон приятнее и спокойнее для глаз — тёплый тёмный (сливово-графитовый),
     без яркого фиолетового, огоньки еле заметные. */
  --bg: #1b1619;
  --card: linear-gradient(135deg, rgba(255, 235, 245, .085) 0%, rgba(255, 235, 245, .05) 55%, rgba(255, 235, 245, .035) 100%);
  --card-solid: #262024;
  --glass-border: rgba(255, 235, 245, .1);
  --glass-blur: blur(18px) saturate(160%);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 235, 245, .1);
  --glass-btn: linear-gradient(135deg, rgba(230, 120, 170, .26) 0%, rgba(170, 130, 210, .24) 100%);
  --glass-btn-shadow: 0 8px 20px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 235, 245, .18),
    inset 0 0 0 1px rgba(255, 235, 245, .06);
  --text: #ece2e7;                     /* не чисто белый — мягче для глаз */
  --muted: #a99ba3;
  --line: rgba(255, 225, 240, .1);
  --accent: #f0a0c4;
  --accent-text: #ffffff;
  --btn: linear-gradient(135deg, #8d3a72 0%, #5a3f9c 50%, #2f6b97 100%);
  --btn-shine: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%);
  --chip: rgba(255, 235, 245, .07);
  --bokeh-1: rgba(230, 110, 160, .1);
  --bokeh-2: rgba(160, 120, 200, .09);
  --bokeh-3: rgba(230, 150, 120, .07);
  --read-bg: #1b1619;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

/* Огоньки-«боке» на фоне (отдельным слоем: на телефонах background-attachment: fixed капризен) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46vmax 36vmax at 4% 4%, var(--bokeh-1), transparent 68%),
    radial-gradient(40vmax 32vmax at 96% 22%, var(--bokeh-2), transparent 68%),
    radial-gradient(48vmax 38vmax at 74% 96%, var(--bokeh-3), transparent 68%),
    radial-gradient(30vmax 24vmax at 12% 70%, var(--bokeh-2), transparent 70%),
    radial-gradient(18vmax 14vmax at 50% 48%, var(--bokeh-1), transparent 72%),
    var(--bg);
}
/* Страница чтения — ровный спокойный фон, без огоньков */
body.plain::before { background: var(--read-bg); }

/* Стекло: всё, что раньше было «карточкой» */
.icon-btn, .novel-card, .continue-card, .locked, .fav-btn, .chip-btn, .hint-box, .before,
.stat-tile, .stat-chart, .dialog, .sheet, .editor, .tag, .seg {
  background: var(--card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
/* На спокойной странице чтения стекло не нужно */
body.plain .locked, body.plain .icon-btn { box-shadow: none; }

button { font: inherit; color: inherit; }
a { color: inherit; }

.loading, .message {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* Шапка */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
}
.topbar h1 {
  flex: 1;
  margin: 0;
  font-size: 22px;
}
.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  cursor: pointer;
}

/* Список новелл */
.novel-list { display: grid; gap: 12px; }
.novel-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: 20px;
  text-decoration: none;
}
.novel-card img, .cover-ph {
  width: 84px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(120, 90, 180, .22);
  background: var(--chip);
  flex-shrink: 0;
}
.novel-card h2 { margin: 0 0 4px; font-size: 17px; }
.byline { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.status { color: var(--muted); font-size: 13px; margin-top: 6px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--chip);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}

/* Страница новеллы */
.novel-head { display: flex; gap: 16px; margin-bottom: 16px; }
.novel-head .cover-btn {
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
  flex-shrink: 0;
}
.novel-head img, .novel-head .cover-ph { width: 120px; height: 172px; }
.novel-head img { object-fit: cover; border-radius: 10px; display: block; }
.novel-head h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.2; }
.meta { color: var(--muted); font-size: 14px; margin: 8px 0; }

.description { line-height: 1.55; }
.description p { margin: 0 0 10px; }
.description.collapsed {
  max-height: 7.5em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}
.link-btn {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.toc { margin-top: 20px; }
.toc h2 { font-size: 18px; margin: 0 0 8px; }
.toc-volume {
  margin: 16px 0 4px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.toc-part {
  margin: 12px 0 2px;
  padding-left: 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.toc-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.toc-item .t { flex: 1; }
.toc-item .s { color: var(--muted); font-size: 13px; white-space: nowrap; }
.paid { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Глава */
.chapter-where { color: var(--muted); font-size: 14px; line-height: 1.4; }
.chapter-novel { color: var(--muted); font-size: 14px; margin: 0; }
.chapter-place { color: var(--accent); font-weight: 600; }
.chapter-title { font-size: 22px; margin: 4px 0 20px; line-height: 1.25; }
.chapter-text {
  font-family: var(--read-font, Georgia, serif);
  font-size: var(--read-size, 18px);
  line-height: var(--read-lh, 1.6);
}

/* Сноски (её выбор): переводчика — ягодно-розовый (*), автора — нежно-голубой (номер);
   жирный курсив в стеклянной таблетке, окошко пояснения — тонированное стекло. */
:root {
  --note-tr: #c0397c;
  --note-tr-bg: #ffe1ee;
  --note-tr-glass: rgba(255, 228, 240, .86);
  --note-au: #3d6fc0;
  --note-au-bg: #e1ecff;
  --note-au-glass: rgba(228, 238, 255, .86);
  --note-gloss: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 60%);
}
:root[data-theme="dark"] {
  --note-tr: #f39ac4;
  --note-tr-bg: #3a2030;
  --note-tr-glass: rgba(58, 32, 48, .9);
  --note-au: #9cc0f5;
  --note-au-bg: #1d2638;
  --note-au-glass: rgba(29, 38, 56, .9);
  --note-gloss: linear-gradient(180deg, rgba(255, 245, 250, .14), rgba(255, 245, 250, 0) 60%);
}
.chapter-text sup[data-note] {
  color: var(--note-tr);
  background: var(--note-gloss), var(--note-tr-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7), 0 1px 3px rgba(150, 90, 150, .2);
  font-weight: 700;
  font-style: italic;
  font-size: .72em;
  line-height: 1;
  padding: .12em .42em .08em .32em;
  margin: 0 .1em;
  border-radius: 999px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  vertical-align: .55em;
}
.chapter-text sup[data-note][data-kind="a"] { color: var(--note-au); background: var(--note-gloss), var(--note-au-bg); }
:root[data-theme="dark"] .chapter-text sup[data-note] { box-shadow: inset 0 0 0 1px rgba(255, 235, 245, .12); }
.note-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 16;
  max-width: 760px;
  margin: 0 auto;
  max-height: 50vh;
  overflow-y: auto;
  background: var(--card);
  color: var(--text);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 -10px 30px rgba(120, 80, 140, .2), inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  cursor: pointer;
}
:root[data-theme="dark"] .note-sheet {
  border-top-color: rgba(255, 235, 245, .14);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 235, 245, .1);
}
.note-head { font-size: 13px; color: var(--note-tr); font-weight: 700; font-style: italic; margin-bottom: 6px; }
.note-sheet.translator { background: var(--note-gloss), var(--note-tr-glass); }
.note-sheet.author { background: var(--note-gloss), var(--note-au-glass); }
.note-sheet.author .note-head { color: var(--note-au); }
.note-body { font-size: 16px; line-height: 1.5; }
.note-hint { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; }

/* Картинки в главах */
.chapter-text p.image { text-align: center; margin: 1em 0; }
.chapter-text img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: zoom-in;
  -webkit-user-drag: none;
  user-select: none;
}

/* Манхва: картинки встык во всю ширину колонки, без полей */
.page.manhwa-page { max-width: 800px; padding-left: 0; padding-right: 0; }
.manhwa-page > .topbar, .manhwa-page > .chapter-where, .manhwa-page > .chapter-title,
.manhwa-page > .chapter-nav, .manhwa-page > .locked { margin-left: 16px; margin-right: 16px; }
.chapter-text.manhwa { font-size: 0; line-height: 0; margin: 0; }
.chapter-text.manhwa p.image { margin: 0; }
.chapter-text.manhwa img { display: block; width: 100%; border-radius: 0; cursor: default; }
@media (max-width: 767px) {
  .page.reading.manhwa-page .chapter-text { margin-left: 0; margin-right: 0; }
}

/* Защита от копирования у читателей (класс protect снимается у админа) */
.protect body, .protect .chapter-text, .protect .chapter-text * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}
.protect input, .protect textarea {
  -webkit-user-select: text !important;
  user-select: text !important;
}
@media print {
  .protect #app, .protect .sheet { display: none !important; }
  .protect body::after {
    content: "Текст защищён. Читайте в RD Lib: https://t.me/RiaRead_app";
    display: block;
    padding: 40px;
    font-size: 18px;
  }
}

/* Ширина текста: компьютер — колонка 620 / 760 / всё окно; телефон — поля 42 / 22 / 8 px */
:root { --col: 760px; --pad: 22px; }
:root[data-width="narrow"] { --col: 620px; --pad: 42px; }
:root[data-width="wide"] { --col: 100%; --pad: 8px; }
.page.reading { max-width: var(--col); }
@media (max-width: 767px) {
  .page.reading .chapter-text { margin-left: calc(var(--pad) - 16px); margin-right: calc(var(--pad) - 16px); }
}
.chapter-text p { margin: 0 0 .9em; }
.locked {
  background: var(--card);
  border-radius: 20px;
  padding: 24px 16px;
  text-align: center;
  line-height: 1.5;
}
.locked-icon { font-size: 28px; margin: 0 0 4px; }
.open-at { color: var(--accent); font-weight: 600; }
/* Начало открытой главы для не подписчика — текст растворяется к концу */
.chapter-text.preview {
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
  margin-bottom: 8px;
}
.locked .btn { width: 100%; margin-top: 10px; }
.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 32px;
}
/* Стеклянная кнопка-конфета: полупрозрачный перелив розовый → лиловый → голубой,
   сквозь неё видно фон; светлая кромка и глянцевый блик сверху, как у обёртки */
.btn {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--btn-shine), var(--glass-btn);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--glass-btn-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: scale(.98); }
.btn.ghost {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--glass-shadow);
}
.btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }

.icon-btn.link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.spacer { flex: 1; }
.topbar .icon-btn { white-space: nowrap; }
/* На узком экране у «← Все новеллы» остаётся только стрелка */
@media (max-width: 480px) {
  .home-label { display: none; }
}

/* Сообщение внизу */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: 30;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Админка ---------- */
.admin .btn { margin: 8px 0; width: 100%; }
.btn.danger { background: transparent; color: #c0392b; border: 1px solid currentColor; margin-top: 32px; }
:root[data-theme="dark"] .btn.danger { color: #ff8f80; }
.btn:disabled { opacity: .6; }
.admin-title { font-size: 22px; margin: 4px 0; line-height: 1.25; }
.admin-sub { font-size: 18px; margin: 20px 0 4px; }
.admin-actions { margin: 12px 0 20px; }
.admin-list { margin-top: 12px; }
.admin-row, .ch-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.admin-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.admin-row .t, .ch-title { flex: 1; font-weight: 600; text-decoration: none; }
.admin-row .s, .ch-top .s { color: var(--muted); font-size: 13px; white-space: nowrap; }

.ch-row, .review-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ch-bottom { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.ch-bottom .seg { flex: 1; }
.ch-icons { display: flex; gap: 4px; margin-left: 4px; }
.select-bar { margin: 8px 0; }
.select-bar .bulk { margin: 8px 0 0; }
.bulk[hidden] { display: none; }
.ch-check { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent); align-self: center; }
.danger-chip { color: #c0392b; border-color: currentColor; }
:root[data-theme="dark"] .danger-chip { color: #ff8f80; }
.chip-btn:disabled { opacity: .45; }
.ch-icons .icon-btn { height: 32px; min-width: 32px; padding: 0 6px; }
.link-text { word-break: break-all; font-size: 12px; }
.copy-area { width: 100%; font: 12px/1.4 monospace; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }

.seg {
  display: flex;
  background: var(--chip);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 7px 2px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.seg-btn.on {
  background: var(--btn-shine), var(--glass-btn);
  color: var(--accent-text);
  font-weight: 700;
  box-shadow: var(--glass-btn-shadow);
}

.review-row.old { opacity: .85; }
.schedule-line { color: var(--accent); font-size: 13px; margin: 4px 0 0; }
.related-pick .radio input { width: 18px; height: 18px; accent-color: var(--accent); }
.radio { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; }
.dialog .radio input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.dialog input[type="datetime-local"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 4px 0 8px;
}
.dialog .field-label { margin-top: 12px; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-row .field-label { margin-bottom: 0; }
.dialog input:disabled, .dialog .link-btn:disabled { opacity: .4; }
.hint.error { color: #c0392b; }
:root[data-theme="dark"] .hint.error { color: #ff8f80; }
.first-line { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
.bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0; font-size: 14px; }
.chip-btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}
.before { margin: 12px 0; background: var(--card); border-radius: 12px; padding: 10px 12px; }
.before summary { cursor: pointer; font-size: 14px; }
.before p { font-size: 13px; color: var(--muted); margin: 6px 0; }
.hint, .hint-box p { color: var(--muted); font-size: 14px; line-height: 1.45; }
.hint-box { background: var(--card); border-radius: 12px; padding: 4px 12px; margin: 12px 0; }

/* Статистика */
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
@media (min-width: 600px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: var(--card); border-radius: 12px; padding: 12px; }
.stat-num { font-size: 24px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--muted); line-height: 1.3; }
.stat-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 140px;
  padding: 8px;
  background: var(--card);
  border-radius: 12px;
}
.stat-bar {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  opacity: .55;
  cursor: pointer;
}
.stat-bar.on, .stat-bar:hover { opacity: 1; }
.stat-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 4px 2px; }
.stat-table { margin: 8px 0; }
.stat-table[hidden] { display: none; }
.stat-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stat-ch { padding: 8px 0; border-bottom: 1px solid var(--line); }
.stat-track { display: flex; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.stat-fill { height: 100%; background: var(--accent); }
.stat-fill.locked { background: var(--note-au); }

.form { margin-top: 12px; }
.field { display: block; margin: 0 0 14px; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input[type="text"], .field select, .field textarea, .dialog input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.field textarea { resize: vertical; line-height: 1.5; }
.cover-edit { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cover-edit img { width: 90px; height: 128px; object-fit: cover; border-radius: 8px; }

.toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 4px;
  padding: 6px 0;
  background: var(--bg);
}
.tool {
  min-width: 40px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  cursor: pointer;
}
.editor {
  min-height: 50vh;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  outline: none;
}
.editor:focus { border-color: var(--accent); }
.toolbar { flex-wrap: wrap; }
.editor sup[data-note] { cursor: pointer; }
.dialog .btn.danger { margin-top: 12px; }
.dialog .seg { margin-bottom: 10px; }

.dialog-back {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dialog {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border-radius: 16px;
  padding: 16px;
}
.dialog .btn { width: 100%; margin-top: 12px; }

/* ---------- Главная: продолжить, избранное ---------- */
.section-title { font-size: 18px; margin: 20px 0 10px; }
.continue-list { display: grid; gap: 10px; }
.continue-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--card);
  border-radius: 20px;
  text-decoration: none;
}
.continue-card img, .continue-card .cover-ph { width: 48px; height: 68px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.continue-body { flex: 1; min-width: 0; padding-right: 24px; }
.continue-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.continue-remove:hover { background: var(--chip); color: var(--text); }
.continue-title { font-weight: 600; margin-bottom: 2px; }
.continue-body .byline { margin-bottom: 6px; }

.progress {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill { display: block; height: 100%; background: var(--accent); }
.toc-item.current .t { font-weight: 600; }
.pct { color: var(--accent); font-size: 13px; font-weight: 600; }

.fav-btn {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
}
.fav-btn.on { color: var(--accent); border-color: var(--accent); }
.novel-head + .tags { margin-bottom: 4px; }
.page > .btn { margin: 12px 0; }

/* ---------- Связанные произведения ---------- */
.related { margin: 8px 0 4px; }
.related .section-title { margin-top: 12px; }
.related-card { margin-bottom: 8px; border: 1px solid var(--line); }
.related-go { color: var(--accent); font-size: 20px; font-weight: 700; }

/* ---------- EPUB ---------- */
.epub-box { margin: 16px 0 4px; }
.epub-buttons { display: grid; gap: 8px; }
.epub-buttons .btn { margin: 0; }
.epub-msg p { color: var(--muted); font-size: 14px; margin: 10px 0; }
.epub-msg .locked p { color: var(--text); }
.epub-msg .btn { width: 100%; margin-top: 8px; }
.promo-title { font-weight: 700; font-size: 17px; }

/* ---------- Закладки ---------- */
.bookmark-list { margin-top: 8px; }
.bookmark {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.bookmark-link { flex: 1; text-decoration: none; min-width: 0; }
.bookmark-title { font-weight: 600; }
.bookmark-snippet { color: var(--muted); font-style: italic; margin: 4px 0; font-size: 14px; }

/* ---------- Окно «Настройки чтения» ---------- */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  max-height: 62vh;
  overflow-y: auto;
  background: var(--card);
  color: var(--text);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  max-width: 760px;
  margin: 0 auto;
}
body.sheet-open #app { padding-bottom: 62vh; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 17px; }
.sheet-label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

.swatches { display: flex; gap: 10px; }
.theme-swatch {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
}
.theme-swatch.light { background: linear-gradient(135deg, #ffe3ef, #efe6ff, #e1f3ff); color: #2d2540; }
.theme-swatch.dark { background: linear-gradient(135deg, #2c2128, #1b1619); color: #ece2e7; }
.theme-swatch.on { border-color: var(--accent); }
.theme-swatch .aa { font-size: 20px; font-family: Georgia, serif; }

.font-tiles {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.font-tile {
  flex: 0 0 auto;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--card-solid);
  cursor: pointer;
}
.font-tile.on { border-color: var(--accent); }
.font-tile .aa { font-size: 22px; }
.font-tile .nm { font-size: 12px; color: var(--muted); }

.slider { display: block; }
.slider-top { display: flex; align-items: baseline; justify-content: space-between; }
.slider-val { font-size: 13px; font-weight: 600; }
/* Ползунок: тонкая стеклянная дорожка и бегунок — стеклянный лиловый ромбик с бликом */
.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  cursor: pointer;
}
.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 175, 210, .55), rgba(190, 160, 255, .55), rgba(150, 210, 255, .55));
  box-shadow: inset 0 1px 2px rgba(120, 90, 180, .25), 0 0 0 1px rgba(255, 255, 255, .6);
}
.slider input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 175, 210, .55), rgba(190, 160, 255, .55), rgba(150, 210, 255, .55));
  box-shadow: inset 0 1px 2px rgba(120, 90, 180, .25), 0 0 0 1px rgba(255, 255, 255, .6);
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 4px;
  transform: rotate(45deg);
  border: 1px solid rgba(255, 255, 255, .95);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(135deg, #e9dcff 0%, #b892ff 55%, #8a62e6 100%);
  box-shadow: 0 3px 10px rgba(140, 90, 230, .45), inset 0 -2px 4px rgba(90, 50, 180, .35);
}
.slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  transform: rotate(45deg);
  border: 1px solid rgba(255, 255, 255, .95);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(135deg, #e9dcff 0%, #b892ff 55%, #8a62e6 100%);
  box-shadow: 0 3px 10px rgba(140, 90, 230, .45), inset 0 -2px 4px rgba(90, 50, 180, .35);
}
.slider input[type="range"]:focus-visible { outline: none; }
.slider input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(184, 146, 255, .35); }

/* Крупная обложка */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, .88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
}
.overlay[hidden] { display: none; }
.overlay img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.overlay .close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* ---------- главная: «Вы остановились здесь», анонсы, полка, каналы ---------- */
@keyframes rd-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: rd-fade .28s ease-out; }

.hero, .channel-card, .pager-btn {
  background: var(--card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.hero { position: relative; border-radius: 24px; overflow: hidden; margin: 6px 0 4px; }
.hero-label::before { content: "✦ "; }
/* обложка растворяется до текста, чтобы текст не лежал поверх картинки */
.hero-cover { display: block; height: 230px; }
.hero-cover img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
}
.hero-cover:empty { height: 8px; }
.hero-body { padding: 0 18px 18px; margin-top: -28px; position: relative; }
.hero-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hero-label { flex: 1; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.hero-count, .hero-x {
  border: 1px solid var(--glass-border); background: var(--chip); color: var(--text);
  border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer;
}
.hero-count { padding: 3px 10px; font-variant-numeric: tabular-nums; font-weight: 600; }
.hero-x { width: 28px; height: 28px; line-height: 1; font-size: 18px; color: var(--muted); }
.hero-title { font-size: 22px; line-height: 1.25; margin: 2px 0 4px; }
.hero-chapter { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.hero .progress { margin-bottom: 14px; }
.hero-notes { color: var(--muted); font-size: 13px; margin-top: 10px; text-align: center; }
.hero-notes:empty { display: none; }

.ann-strip {
  display: flex; align-items: flex-start; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none;
}
.ann-strip::-webkit-scrollbar { display: none; }
.ann-item {
  flex: 0 0 118px; scroll-snap-align: start; border: 0; background: none; padding: 0;
  text-align: left; color: var(--text); font: inherit; cursor: pointer;
}
.ann-item img {
  width: 118px; aspect-ratio: 3 / 4; object-fit: cover; display: block; border-radius: 14px;
  border: 1px solid var(--glass-border); box-shadow: 0 6px 18px rgba(140, 110, 200, .22);
}
.ann-soon { display: block; font-size: 11px; color: var(--accent); font-weight: 600; margin-top: 6px; }
.ann-title { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; margin-top: 1px; }

.manhwa-row { margin-top: 8px; }
.manhwa-row .poster { flex: 0 0 31%; max-width: 150px; scroll-snap-align: start; }
.shelf-tabs { margin-bottom: 14px; }
.poster-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; }
@media (max-width: 359px) { .poster-grid { grid-template-columns: repeat(2, 1fr); } }
.shelf-empty { grid-column: 1 / -1; }
.poster { color: var(--text); text-decoration: none; min-width: 0; }
.poster-cover { position: relative; }
.poster-cover img, .poster-cover .cover-ph {
  width: 100%; aspect-ratio: 3 / 4; height: auto; object-fit: cover; display: block; border-radius: 14px;
  border: 1px solid var(--glass-border); box-shadow: 0 6px 18px rgba(140, 110, 200, .22);
}
.poster-fav {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; color: #e0457f;
  background: rgba(255, 255, 255, .78); border: 1px solid rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.poster-status { font-size: 11px; color: var(--muted); margin-top: 6px; }
.poster-title {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pager[hidden] { display: none; }
.pager-btn {
  min-width: 36px; height: 36px; border-radius: 12px; color: var(--text); font: inherit;
  font-size: 14px; cursor: pointer; padding: 0 8px;
}
.pager-btn.on { background: var(--btn-shine), var(--glass-btn); box-shadow: var(--glass-btn-shadow); color: var(--accent-text); font-weight: 700; }
.pager-btn:disabled { opacity: .4; cursor: default; }

.channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 28px; }
.channel-card {
  border-radius: 18px; padding: 14px; text-align: center; color: var(--text); font: inherit;
  font-weight: 700; cursor: pointer;
}

/* админка: анонсы */
.ann-preview { width: 110px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; display: block; margin: 0 0 12px; }
.ann-preview[hidden] { display: none; }
.ann-admin { display: grid; gap: 10px; margin-top: 20px; }
.ann-admin-row { display: flex; align-items: center; gap: 12px; }
.ann-admin-row img { width: 54px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.ann-admin-row .t { flex: 1; min-width: 0; font-weight: 600; }
.ann-admin-row .btn { flex: 0 0 auto; width: auto; margin: 0; padding: 8px 14px; }

/* ---------- Кнопки «жидкое стекло» (её картинки: Liquid Glass, стеклянные пузыри) ----------
   ПРОЗРАЧНОЕ стекло, сквозь которое видно фон: почти без заливки, яркий глянцевый
   блик-полумесяц сверху, светлая кромка, светлое преломление внутри снизу и мягкая тень
   под кнопкой. Главная — прозрачное стекло с розово-лиловым оттенком, остальные — чистое. */
:root {
  /* блик-полумесяц сверху: чёткий край, как у стеклянного пузыря */
  --lg-gloss: radial-gradient(80% 55% at 50% 4%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .55) 45%, rgba(255, 255, 255, 0) 62%);
  --lg-primary: var(--lg-gloss),
    linear-gradient(135deg, rgba(205, 160, 255, .45) 0%, rgba(255, 150, 200, .42) 100%);
  --lg-primary-shadow: 0 0 0 1px rgba(150, 90, 180, .28), inset 0 0 0 1.5px rgba(255, 255, 255, .85),
    inset 0 -2px 0 rgba(255, 255, 255, .95), inset 0 -8px 12px rgba(255, 255, 255, .45),
    0 14px 22px -10px rgba(170, 90, 200, .55), 0 4px 10px -4px rgba(255, 140, 190, .35);
  --lg-primary-text: #4a2160;
  --lg-pill: var(--lg-gloss), rgba(255, 225, 238, .16);
  --lg-pill-shadow: 0 0 0 1px rgba(150, 100, 170, .22), inset 0 0 0 1.5px rgba(255, 255, 255, .9),
    inset 0 -2px 0 rgba(255, 255, 255, .95), inset 0 -8px 12px rgba(255, 255, 255, .4),
    0 12px 20px -10px rgba(120, 80, 140, .5);
  --lg-border: transparent;
  --lg-blur: blur(5px) saturate(180%);
}
:root[data-theme="dark"] {
  --lg-gloss: radial-gradient(90% 60% at 50% 0%, rgba(255, 245, 250, .3) 0%, rgba(255, 245, 250, .07) 55%, rgba(255, 245, 250, 0) 70%);
  --lg-primary: var(--lg-gloss),
    linear-gradient(135deg, rgba(170, 130, 230, .3) 0%, rgba(230, 120, 170, .26) 100%);
  --lg-primary-shadow: inset 0 0 0 1.5px rgba(255, 235, 245, .28), inset 0 -6px 12px rgba(255, 235, 245, .1),
    0 12px 20px -10px rgba(0, 0, 0, .7);
  --lg-primary-text: #f6eef8;
  --lg-pill: var(--lg-gloss), rgba(255, 235, 245, .04);
  --lg-pill-shadow: inset 0 0 0 1.5px rgba(255, 235, 245, .22), inset 0 -6px 12px rgba(255, 235, 245, .07),
    0 10px 18px -10px rgba(0, 0, 0, .7);
  --lg-border: rgba(255, 235, 245, .14);
}

.btn, .icon-btn, .chip-btn, .fav-btn, .seg, .pager-btn, .channel-card, .hero-count, .hero-x {
  border-radius: 999px;
  border: 1px solid var(--lg-border);
  -webkit-backdrop-filter: var(--lg-blur);
  backdrop-filter: var(--lg-blur);
  transition: transform .12s, box-shadow .12s;
}
.btn {
  background: var(--lg-primary);
  color: var(--lg-primary-text);
  box-shadow: var(--lg-primary-shadow);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
  padding: 13px 12px;
}
:root[data-theme="dark"] .btn { text-shadow: none; }
.btn.ghost, .icon-btn, .chip-btn, .fav-btn, .pager-btn, .channel-card, .hero-count, .hero-x {
  background: var(--lg-pill);
  color: var(--text);
  box-shadow: var(--lg-pill-shadow);
  text-shadow: none;
}
.btn:active, .icon-btn:active, .chip-btn:active, .fav-btn:active, .pager-btn:active,
.channel-card:active { transform: scale(.97); }
.btn.danger { background: var(--lg-pill); box-shadow: var(--lg-pill-shadow); text-shadow: none; }
.pager-btn.on { background: var(--lg-primary); box-shadow: var(--lg-primary-shadow); color: var(--lg-primary-text); }
.fav-btn.on { color: var(--accent); border-color: var(--lg-border); }
.channel-card { padding: 15px 12px; }

/* Переключатели — как «Toast / Tabs» на картинке: стеклянный жёлоб, выбранная — белая таблетка */
.seg {
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 2px 5px rgba(110, 80, 130, .14), inset 0 0 0 1px rgba(255, 255, 255, .5);
  padding: 4px;
  gap: 4px;
}
:root[data-theme="dark"] .seg { background: rgba(0, 0, 0, .12); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .35); }
.seg-btn { border-radius: 999px; padding: 8px 4px; }
.seg-btn.on {
  background: var(--lg-primary);
  color: var(--lg-primary-text);
  box-shadow: var(--lg-primary-shadow);
}

/* «эксклюзив» — её выбор: тонкая полупрозрачная лента по нижнему краю обложки,
   как подпись на суперобложке (крупная плашка в углу была «наляписто»). */
.poster-cover, .hero-cover, .novel-head .cover-btn { position: relative; }
.poster-cover { border-radius: 14px; overflow: hidden; }
.novel-head .cover-btn { border-radius: 10px; overflow: hidden; }
.excl-badge {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 4px 0;
  text-align: center; font-size: 10.5px; font-weight: 500; letter-spacing: .12em; line-height: 1.3;
  color: rgba(255, 255, 255, .95);
  background: rgba(30, 18, 30, .42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
/* у «Вы остановились здесь» низ обложки растворяется в текст — лента сверху */
.hero-cover .excl-badge { bottom: auto; top: 0; padding: 5px 0; font-size: 11px; }

/* ---------- Страница новеллы (шаг 3): обложка на весь верх, главы со сворачиванием ---------- */
.novel-hero { margin-top: 4px; }
.novel-hero .hero-cover { height: 320px; width: 100%; border: 0; padding: 0; background: none; cursor: zoom-in; }
.novel-hero div.hero-cover { cursor: default; height: 8px; }
.novel-hero .hero-cover img {
  object-position: center 20%;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 96%);
  mask-image: linear-gradient(to bottom, #000 40%, transparent 96%);
}
.novel-hero .hero-body { margin-top: -6px; }
.novel-hero .tags { margin-bottom: 8px; }
.novel-hero .hero-title { font-size: 24px; margin: 0 0 4px; }
.novel-hero .byline { margin: 0 0 2px; }
.novel-hero .meta { margin: 6px 0 14px; }
.tag-more { cursor: pointer; font-weight: 600; }
.novel-actions { display: grid; gap: 10px; }
.novel-actions .btn { margin: 0; }
.novel-actions .fav-btn { justify-self: center; margin: 2px 0 0; padding: 8px 18px; }
.page > .description { margin-top: 18px; }

.early-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 16px 0 4px; padding: 12px 16px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.early-text { font-size: 14px; }
.early-box .link-btn { padding: 0; }

.toc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.toc-head h2 { margin: 0; }
.toc-order { flex: 0 1 260px; }
.toc-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; user-select: none;
}
.toc-group > summary::-webkit-details-marker { display: none; }
.toc-group > summary::after {
  content: "›"; margin-left: auto; font-size: 18px; line-height: 1; color: var(--muted);
  transition: transform .2s;
}
.toc-group[open] > summary::after { transform: rotate(90deg); }
.toc-group.vol > summary { padding: 12px 0 8px; border-bottom: 1px solid var(--line); margin: 6px 0 0; }
.toc-group.part > summary { padding: 10px 0 4px; margin: 4px 0 0; }
.toc-group.part { padding-left: 4px; }

/* ---------- Её решение: обложка видна ЦЕЛИКОМ (во всю ширину блока, без обрезки и
   растворения), а стеклянная панель со всеми надписями и кнопками лежит ПОВЕРХ обложки,
   внутри панели переливается вода. ---------- */
.hero .hero-cover:has(img) { height: auto; display: block; }
.hero .hero-cover img, .novel-hero .hero-cover img {
  height: auto; object-fit: initial;
  -webkit-mask-image: none; mask-image: none;
}
.hero:has(.hero-cover img) > .hero-body {
  position: absolute; left: 10px; right: 10px; bottom: 10px; margin: 0;
  padding: 14px 16px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .62), rgba(255, 245, 250, .42));
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 10px 28px -10px rgba(80, 40, 90, .45), inset 0 1px 0 rgba(255, 255, 255, .95);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
}
:root[data-theme="dark"] .hero:has(.hero-cover img) > .hero-body {
  background: linear-gradient(135deg, rgba(40, 30, 38, .62), rgba(27, 22, 25, .5));
  border-color: rgba(255, 235, 245, .14);
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 235, 245, .12);
}
.hero:has(.hero-cover img) { padding: 0; }
.novel-hero:has(.hero-cover img) .hero-body { margin: 0; }
.hero-notes { text-align: left; }

/* вода внутри стеклянной панели: мягкие розовые, лиловые, голубые разводы + бегущий блик */
.water { overflow: hidden; isolation: isolate; }
.water::before, .water::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.water::before {
  inset: -40%;
  background:
    radial-gradient(28% 22% at 30% 35%, rgba(255, 170, 210, .4), transparent 70%),
    radial-gradient(26% 24% at 70% 30%, rgba(195, 170, 255, .36), transparent 70%),
    radial-gradient(30% 22% at 55% 70%, rgba(165, 215, 255, .34), transparent 70%),
    radial-gradient(22% 18% at 25% 75%, rgba(255, 200, 225, .32), transparent 70%);
  animation: rd-water 16s ease-in-out infinite alternate;
}
.water::after {
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .3) 48%, transparent 60%);
  background-size: 250% 100%;
  animation: rd-ripple 9s ease-in-out infinite;
}
@keyframes rd-water {
  0%   { transform: translate(-6%, -4%) rotate(0deg) scale(1); }
  50%  { transform: translate(5%, 4%) rotate(14deg) scale(1.08); }
  100% { transform: translate(-3%, 6%) rotate(-10deg) scale(1.02); }
}
@keyframes rd-ripple {
  0%, 100% { background-position: 120% 0; }
  50%      { background-position: -20% 0; }
}
:root[data-theme="dark"] .water::before {
  background:
    radial-gradient(28% 22% at 30% 35%, rgba(230, 110, 170, .18), transparent 70%),
    radial-gradient(26% 24% at 70% 30%, rgba(160, 120, 230, .18), transparent 70%),
    radial-gradient(30% 22% at 55% 70%, rgba(110, 170, 230, .15), transparent 70%),
    radial-gradient(22% 18% at 25% 75%, rgba(230, 150, 190, .14), transparent 70%);
}
:root[data-theme="dark"] .water::after {
  background: linear-gradient(105deg, transparent 35%, rgba(255, 235, 245, .08) 48%, transparent 60%);
  background-size: 250% 100%;
}
@media (prefers-reduced-motion: reduce) { .water::before, .water::after { animation: none; } }

.hero > .hero-body { position: relative; }

/* ---------- Её правка: без стеклянной панели. Надписи и кнопки прямо на обложке,
   под ними мягкая дымка без контура (снизу гуще, кверху тает в обложку),
   надписи подчёркнуты светлым ореолом. ---------- */
.hero:has(.hero-cover img) > .hero-body {
  left: 0; right: 0; bottom: 0;
  padding: 56px 18px 16px;
  border: 0; border-radius: 0; box-shadow: none; background: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  isolation: isolate;
}
:root[data-theme="dark"] .hero:has(.hero-cover img) > .hero-body { background: none; border: 0; box-shadow: none; }
.hero:has(.hero-cover img) > .hero-body::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(255, 242, 247, .94) 0%, rgba(255, 242, 247, .82) 50%, rgba(255, 242, 247, 0) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent 100%);
  mask-image: linear-gradient(to top, #000 55%, transparent 100%);
}
:root[data-theme="dark"] .hero:has(.hero-cover img) > .hero-body::before {
  background: linear-gradient(to top, rgba(27, 22, 25, .94) 0%, rgba(27, 22, 25, .8) 50%, rgba(27, 22, 25, 0) 100%);
}
/* акцент надписей: чуть крупнее и с мягким ореолом вместо подложки */
.hero:has(.hero-cover img) .hero-title {
  font-weight: 800; letter-spacing: -.01em;
  text-shadow: 0 0 14px rgba(255, 245, 250, .95), 0 1px 2px rgba(255, 255, 255, .8);
}
.hero:has(.hero-cover img) .hero-label,
.hero:has(.hero-cover img) .hero-chapter,
.hero:has(.hero-cover img) .byline,
.hero:has(.hero-cover img) .meta,
.hero:has(.hero-cover img) .hero-notes {
  text-shadow: 0 0 10px rgba(255, 245, 250, .95);
}
.hero:has(.hero-cover img) .hero-chapter, .hero:has(.hero-cover img) .byline,
.hero:has(.hero-cover img) .meta { color: var(--text); opacity: .82; }
:root[data-theme="dark"] .hero:has(.hero-cover img) .hero-title,
:root[data-theme="dark"] .hero:has(.hero-cover img) .hero-label,
:root[data-theme="dark"] .hero:has(.hero-cover img) .hero-chapter,
:root[data-theme="dark"] .hero:has(.hero-cover img) .byline,
:root[data-theme="dark"] .hero:has(.hero-cover img) .meta,
:root[data-theme="dark"] .hero:has(.hero-cover img) .hero-notes {
  text-shadow: 0 0 12px rgba(20, 14, 18, .95), 0 1px 2px rgba(0, 0, 0, .6);
}
.hero:has(.hero-cover img) > .hero-body { padding-top: 14px; }
.hero:has(.hero-cover img) > .hero-body::before {
  inset: -80px 0 0 0;
  background: linear-gradient(to top, rgba(255, 242, 247, .94) 0%, rgba(255, 242, 247, .86) calc(100% - 80px), rgba(255, 242, 247, 0) 100%);
  -webkit-mask-image: linear-gradient(to top, #000 calc(100% - 80px), transparent 100%);
  mask-image: linear-gradient(to top, #000 calc(100% - 80px), transparent 100%);
}
:root[data-theme="dark"] .hero:has(.hero-cover img) > .hero-body::before {
  background: linear-gradient(to top, rgba(27, 22, 25, .94) 0%, rgba(27, 22, 25, .84) calc(100% - 80px), rgba(27, 22, 25, 0) 100%);
}

/* ---------- Её решение (шаг 3д): обложка целиком и БЕЗ подложки, на ней только стеклянные
   кнопки; название/автор/переводчик/статус — в «стеклянном блоке» под обложкой
   (как стеклянный кирпичик на её картинках: прозрачный, толстые светлые грани). ---------- */
.hero.bare {
  background: none; border: 0; box-shadow: none; overflow: visible; padding: 0;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.hero.bare .hero-cover {
  position: relative; display: block; height: auto; width: 100%;
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .8), 0 14px 30px -14px rgba(90, 50, 110, .55);
}
.hero.bare .cover-link { display: block; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; }
.hero.bare .novel-hero .cover-link, .novel-hero.bare .cover-link { cursor: zoom-in; }
.hero.bare .hero-cover img {
  display: block; width: 100%; height: auto; object-fit: initial;
  -webkit-mask-image: none; mask-image: none;
}
.hero.bare .hero-cover:not(:has(img)) { min-height: 0; box-shadow: none; }
/* кнопки поверх обложки: только сами стеклянные пузыри, без фона под ними */
.cover-actions {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 2;
  display: grid; gap: 10px;
}
.hero.bare .hero-cover:not(:has(img)) .cover-actions { position: static; padding: 0; }
.cover-actions .btn { margin: 0; }
.cover-actions .fav-btn { justify-self: center; margin: 0; padding: 8px 18px; }
.cover-top {
  position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 6px; margin: 0;
}
.hero.bare .excl-badge { top: 0; bottom: auto; }

/* стеклянный блок-кирпичик */
.glass-brick {
  position: relative; margin: 14px 0 0; padding: 20px 20px 18px; text-align: center;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, .18) 45%, rgba(255, 255, 255, .3) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .95),
    inset 0 0 0 7px rgba(255, 255, 255, .22),
    inset 0 0 0 8px rgba(255, 255, 255, .7),
    inset 0 0 26px rgba(255, 255, 255, .55),
    0 0 0 1px rgba(150, 110, 160, .18),
    0 16px 28px -16px rgba(90, 50, 110, .5);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  backdrop-filter: blur(8px) saturate(160%);
}
:root[data-theme="dark"] .glass-brick {
  background: linear-gradient(160deg, rgba(255, 235, 245, .1) 0%, rgba(255, 235, 245, .03) 45%, rgba(255, 235, 245, .07) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 235, 245, .3),
    inset 0 0 0 7px rgba(255, 235, 245, .04),
    inset 0 0 0 8px rgba(255, 235, 245, .16),
    inset 0 0 26px rgba(255, 235, 245, .08),
    0 16px 28px -16px rgba(0, 0, 0, .7);
}
.glass-brick .hero-title { margin: 4px 0 8px; font-size: 22px; line-height: 1.25; text-shadow: none; }
.glass-brick .byline { margin: 2px 0; color: var(--muted); }
.glass-brick .meta { margin: 8px 0 0; }
.glass-brick .where { margin-top: 6px; color: var(--accent); }
.glass-brick .hero-label { display: block; }
.glass-brick .hero-chapter { margin-bottom: 10px; }
.glass-brick .progress { margin: 0 auto; max-width: 260px; }
.glass-brick .hero-notes { text-align: center; margin-top: 10px; }
.description .tags { margin-top: 14px; }
.page > .novel-tags { margin-top: 16px; }
/* кнопки поверх обложки: то же стекло, но матовее — чтобы надпись читалась на любой картинке */
.cover-actions .btn, .cover-actions .fav-btn, .cover-top .hero-count, .cover-top .hero-x {
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
}
.cover-actions .btn { background: var(--lg-gloss), linear-gradient(135deg, rgba(225, 195, 255, .62), rgba(255, 185, 220, .58)); }
.cover-actions .btn.ghost, .cover-actions .fav-btn, .cover-top .hero-count, .cover-top .hero-x {
  background: var(--lg-gloss), rgba(255, 245, 250, .5); color: var(--text);
}
:root[data-theme="dark"] .cover-actions .btn { background: var(--lg-gloss), linear-gradient(135deg, rgba(120, 90, 170, .6), rgba(160, 80, 120, .55)); }
:root[data-theme="dark"] .cover-actions .btn.ghost, :root[data-theme="dark"] .cover-actions .fav-btn,
:root[data-theme="dark"] .cover-top .hero-count, :root[data-theme="dark"] .cover-top .hero-x {
  background: var(--lg-gloss), rgba(27, 22, 25, .5);
}

.hero.bare .excl-badge ~ .cover-top { top: 30px; }

/* Шаг 3е: стеклянный блок С НАДПИСЯМИ — тоже на обложке, над кнопками */
.cover-stack {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  display: grid; gap: 10px;
}
.cover-stack .cover-actions { position: static; }
.cover-stack .glass-brick {
  margin: 0; padding: 16px 16px 14px;
  background: linear-gradient(160deg, rgba(255, 250, 252, .66) 0%, rgba(255, 245, 250, .44) 50%, rgba(255, 250, 252, .56) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
}
:root[data-theme="dark"] .cover-stack .glass-brick {
  background: linear-gradient(160deg, rgba(40, 30, 38, .62) 0%, rgba(27, 22, 25, .5) 50%, rgba(40, 30, 38, .58) 100%);
}
.cover-stack .glass-brick .hero-title { font-size: 20px; margin: 2px 0 6px; }
.cover-stack .glass-brick .byline, .cover-stack .glass-brick .hero-chapter { color: var(--text); opacity: .8; }
/* без обложки — блок и кнопки идут обычным потоком */
.hero.bare .hero-cover:not(:has(img)) .cover-stack { position: static; }

/* ---------- Шаг 3ж (её правка): на обложке стекло МАКСИМАЛЬНО ПРОЗРАЧНОЕ, чуть мутноватое,
   БЕЗ обводки — вместо неё ГРАНЁНЫЕ края (светлые скосы по краям, как у огранённого стекла).
   Блок и надписи меньше. Надписи белые с мягкой тенью — читаются на любой обложке. ---------- */
.cover-stack { left: 50%; right: auto; transform: translateX(-50%); width: min(78%, 300px); gap: 8px; bottom: 14px; }
.cover-stack .glass-brick,
.cover-stack .cover-actions .btn, .cover-stack .cover-actions .fav-btn,
.cover-top .hero-count, .cover-top .hero-x {
  border: 0;
  /* грани: светлые скосы сверху и слева, тише снизу и справа */
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to right, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to top, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to left, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 7px),
    rgba(255, 255, 255, .1);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .55),
    inset -1px -1px 0 rgba(255, 255, 255, .18),
    inset 0 0 14px rgba(255, 255, 255, .12),
    0 8px 20px -10px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(5px) saturate(150%);
  backdrop-filter: blur(5px) saturate(150%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 0 12px rgba(0, 0, 0, .35);
}
:root[data-theme="dark"] .cover-stack .glass-brick,
:root[data-theme="dark"] .cover-stack .cover-actions .btn,
:root[data-theme="dark"] .cover-stack .cover-actions .fav-btn,
:root[data-theme="dark"] .cover-top .hero-count, :root[data-theme="dark"] .cover-top .hero-x {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to right, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to top, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to left, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 7px),
    rgba(20, 14, 18, .14);
  color: #fff;
}
/* главная кнопка — с лёгким розовым оттенком в стекле */
.cover-stack .cover-actions .btn:not(.ghost) {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to right, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to top, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to left, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 7px),
    rgba(255, 170, 210, .2);
}
.cover-stack .glass-brick { padding: 10px 12px 9px; border-radius: 16px; }
.cover-stack .glass-brick .hero-title { font-size: 16px; margin: 1px 0 3px; color: #fff; text-shadow: inherit; font-weight: 700; }
.cover-stack .glass-brick .byline, .cover-stack .glass-brick .meta,
.cover-stack .glass-brick .hero-chapter, .cover-stack .glass-brick .hero-notes {
  font-size: 12px; color: #fff; opacity: .92; margin: 1px 0; text-shadow: inherit;
}
.cover-stack .glass-brick .hero-label { font-size: 9.5px; color: #ffd6ea; text-shadow: inherit; }
.cover-stack .glass-brick .where { color: #ffd6ea; margin-top: 3px; }
.cover-stack .glass-brick .progress { margin: 5px auto 0; max-width: 180px; height: 3px; background: rgba(255, 255, 255, .3); }
.cover-stack .glass-brick .progress-fill { background: #ffb8d9; }
.cover-stack .cover-actions { gap: 7px; }
.cover-stack .cover-actions .btn { padding: 9px 10px; font-size: 13.5px; }
.cover-stack .cover-actions .fav-btn { padding: 6px 14px; font-size: 12.5px; }
.cover-stack .cover-actions .fav-btn.on { color: #ffd6ea; }
/* новелла без обложки: блок и кнопки обычным потоком, тёмный текст */
.hero.bare .hero-cover:not(:has(img)) .cover-stack { position: static; transform: none; width: auto; left: auto; }
.hero.bare .hero-cover:not(:has(img)) .cover-stack *,
.hero.bare .hero-cover:not(:has(img)) .cover-stack .glass-brick { color: var(--text); text-shadow: none; }
.cover-stack .glass-brick, .cover-stack .cover-actions .btn, .cover-stack .cover-actions .fav-btn,
.cover-top .hero-count, .cover-top .hero-x {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
  -webkit-backdrop-filter: blur(7px) saturate(150%) brightness(.92);
  backdrop-filter: blur(7px) saturate(150%) brightness(.92);
}
.hero.bare .cover-stack .glass-brick .hero-title,
.hero.bare .cover-stack .glass-brick .hero-label,
.hero.bare .cover-stack .glass-brick .hero-chapter,
.hero.bare .cover-stack .glass-brick .byline,
.hero.bare .cover-stack .glass-brick .meta,
.hero.bare .cover-stack .glass-brick .hero-notes {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7); opacity: 1;
}
.hero.bare .cover-stack .glass-brick .hero-chapter,
.hero.bare .cover-stack .glass-brick .byline,
.hero.bare .cover-stack .glass-brick .meta,
.hero.bare .cover-stack .glass-brick .hero-notes,
.hero.bare .cover-stack .glass-brick .hero-title { color: #fff; }
.hero.bare .cover-stack .glass-brick .hero-label,
.hero.bare .cover-stack .glass-brick .where { color: #ffd6ea; }

/* ---------- Шаг 3з: кнопки страницы новеллы одной строкой; процент мелко над «Продолжить»;
   «в избранное» — стеклянное 3D-сердечко (её картинка), которое хочется нажать пальцем ---------- */
.cover-stack .novel-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.cover-stack .novel-actions .btn {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  white-space: nowrap;
}
.cover-stack .novel-actions .btn-continue { flex-grow: 1.35; }
.btn-note { display: block; font-size: 10px; font-weight: 600; line-height: 1; margin-bottom: 2px; opacity: .9; letter-spacing: .02em; }

.heart-btn {
  flex: 0 0 50px; width: 50px; height: 46px; padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 5px 6px rgba(60, 0, 25, .35)) drop-shadow(0 0 1px rgba(255, 255, 255, .6));
  transition: transform .14s ease-out, filter .2s;
}
.heart-btn svg { display: block; width: 100%; height: 100%; overflow: visible; }
.heart-btn:active { transform: scale(.86); }
.heart-btn .heart-body { fill: url(#rdHeartOff); }
.heart-btn.on .heart-body { fill: url(#rdHeartOn); }
.heart-btn .heart-rim { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 1.6; }
.heart-btn.on .heart-rim { stroke: rgba(255, 210, 228, .9); }
.heart-btn .heart-shine { fill: rgba(255, 255, 255, .9); }
.heart-btn .heart-spark { fill: #fff; opacity: .95; }
.heart-btn.on { filter: drop-shadow(0 5px 8px rgba(200, 20, 90, .45)) drop-shadow(0 0 6px rgba(255, 110, 165, .55)); }
.heart-btn.pulse { animation: rd-heartbeat .5s ease-out; }
@keyframes rd-heartbeat {
  0% { transform: scale(1); } 30% { transform: scale(1.28); } 55% { transform: scale(.94); }
  75% { transform: scale(1.08); } 100% { transform: scale(1); }
}
/* надпись всплывает над сердечком и тает */
.heart-pop {
  position: absolute; right: 0; bottom: 100%; margin-bottom: 8px; z-index: 3;
  white-space: nowrap; font-size: 12px; font-weight: 600; color: #fff;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 140, 190, .32);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  pointer-events: none;
  animation: rd-pop 1.8s ease-out forwards;
}
@keyframes rd-pop {
  0% { opacity: 0; transform: translateY(8px) scale(.9); }
  15% { opacity: 1; transform: translateY(0) scale(1); }
  65% { opacity: 1; transform: translateY(-4px); }
  100% { opacity: 0; transform: translateY(-16px); }
}
@media (prefers-reduced-motion: reduce) { .heart-btn.pulse, .heart-pop { animation: none; } }

/* ---------- Шаг 3и: кнопки не наезжают друг на друга; сердце — капельная стеклянная
   кнопка, внутри стеклянное человеческое сердце; в избранном наполняется кровью ---------- */
.cover-stack { gap: 10px; }
.cover-stack .novel-actions { gap: 10px; }
.cover-stack .novel-actions .btn {
  overflow: hidden; text-overflow: ellipsis; font-size: 13px; padding: 6px 8px;
}
.cover-stack .novel-actions .btn > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.cover-stack .cover-actions .heart-btn {
  flex: 0 0 52px; width: 52px; height: 44px; padding: 4px 0; border-radius: 999px; border: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to right, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to top, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to left, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 7px),
    rgba(255, 255, 255, .1);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .55), inset -1px -1px 0 rgba(255, 255, 255, .18),
    inset 0 0 14px rgba(255, 255, 255, .12), 0 8px 20px -10px rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(7px) saturate(150%) brightness(.92);
  backdrop-filter: blur(7px) saturate(150%) brightness(.92);
  filter: none;
}
.cover-stack .cover-actions .heart-btn.on { filter: none; }
.heart-btn svg { width: 30px; height: 34px; overflow: visible; filter: drop-shadow(0 2px 3px rgba(40, 0, 15, .35)); }
.heart-btn .h-rim { fill: none; stroke: rgba(255, 255, 255, .8); }
.heart-btn .h-glass-tube { fill: none; stroke: rgba(255, 236, 244, .45); }
.heart-btn .h-glass { fill: rgba(255, 236, 244, .38); }
.heart-btn .h-edge { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 1.1; }
.heart-btn .h-vein { fill: none; stroke: rgba(255, 255, 255, .6); stroke-width: .8; stroke-linecap: round; }
.heart-btn .h-shine { fill: rgba(255, 255, 255, .85); }
.heart-btn .h-spark { fill: #fff; }
/* кровь: поднимается снизу вверх */
.heart-btn .h-blood {
  transform-box: fill-box; transform-origin: 50% 100%;
  transform: translateY(100%);
  transition: transform .9s cubic-bezier(.3, .7, .2, 1);
}
.heart-btn.on .h-blood { transform: translateY(0); }
.heart-btn.on .h-vein { stroke: rgba(255, 150, 175, .65); }
.heart-btn.on .h-glass-tube { stroke: rgba(255, 236, 244, .2); }
.heart-btn.on svg { filter: drop-shadow(0 2px 4px rgba(90, 0, 25, .5)) drop-shadow(0 0 5px rgba(200, 20, 60, .35)); }
.cover-stack { width: min(calc(100% - 24px), 380px); }
.cover-stack .glass-brick { width: min(100%, 290px); justify-self: center; }

.cover-stack .novel-actions { left: 0; right: 0; bottom: auto; }

/* ---------- Шаг 3к: сердце — картинки с её референсов в стеклянной капле ---------- */
.cover-stack .cover-actions .heart-btn {
  position: relative; flex: 0 0 46px; width: 46px; height: 46px; padding: 0;
  border-radius: 50%; overflow: hidden;
}
.heart-btn .heart-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; pointer-events: none; user-select: none; -webkit-user-drag: none;
}
/* кровь наливается снизу вверх */
.heart-btn .heart-img.blood { clip-path: inset(100% 0 0 0); transition: clip-path .9s cubic-bezier(.3, .7, .2, 1); }
.heart-btn.on .heart-img.blood { clip-path: inset(0 0 0 0); }
/* стекло капли поверх сердца: блик сверху и гранёные края */
.heart-btn .heart-gloss {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(70% 45% at 50% 8%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 70%),
    radial-gradient(40% 25% at 50% 96%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 70%);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .7), inset -1px -1px 0 rgba(255, 255, 255, .25),
    inset 0 0 8px rgba(255, 255, 255, .35);
}
.heart-btn.on { box-shadow: 0 0 12px rgba(190, 20, 60, .45), 0 8px 20px -10px rgba(0, 0, 0, .45) !important; }

/* ---------- Шаг 3л: сердце вырезано без фона; кнопка — прозрачная капля, как остальные ---------- */
.cover-stack .cover-actions .heart-btn { border-radius: 999px; overflow: visible; width: 52px; flex: 0 0 52px; height: 44px; }
.heart-btn .heart-box { position: relative; display: block; width: 34px; height: 34px; }
.heart-btn .heart-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
}
.heart-btn .heart-img.blood { clip-path: inset(100% 0 0 0); transition: clip-path .9s cubic-bezier(.3, .7, .2, 1); }
.heart-btn.on .heart-img.blood { clip-path: inset(0 0 0 0); }
.heart-btn.on .heart-img.blood { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)) drop-shadow(0 0 4px rgba(170, 10, 40, .55)); }
.heart-btn .heart-gloss { display: none; }

.cover-stack .cover-actions .heart-btn.on { box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .55), inset -1px -1px 0 rgba(255, 255, 255, .18), inset 0 0 14px rgba(255, 255, 255, .12), 0 8px 20px -10px rgba(0, 0, 0, .45) !important; }

/* ---------- Шаг 3м: сердце всегда в правом нижнем углу обложки ---------- */
.hero-cover .heart-btn.heart-corner {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; overflow: visible;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to right, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to top, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 7px),
    linear-gradient(to left, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 7px),
    rgba(255, 255, 255, .1);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .55), inset -1px -1px 0 rgba(255, 255, 255, .18),
    inset 0 0 14px rgba(255, 255, 255, .12), 0 8px 20px -10px rgba(0, 0, 0, .45) !important;
  -webkit-backdrop-filter: blur(7px) saturate(150%) brightness(.92);
  backdrop-filter: blur(7px) saturate(150%) brightness(.92);
}
.hero-cover .heart-btn.heart-corner .heart-pop { right: 0; bottom: 100%; margin-bottom: 8px; }
/* кнопки «Продолжить» / «С начала» оставляют место сердцу справа */
.cover-stack .novel-actions { margin-right: 54px; }
/* красное сердце светится изнутри */
.heart-btn.on .heart-img.blood {
  filter: drop-shadow(0 0 3px rgba(255, 40, 60, .85)) drop-shadow(0 0 9px rgba(220, 0, 30, .6));
}

/* ---------- Шаг 3н: грани без «квадрата» — вместо полосок-градиентов по краям (они давали
   прямоугольник внутри скруглённой кнопки) мягкие внутренние тени, которые повторяют
   скругление. ---------- */
:root {
  --facet-glass: rgba(255, 255, 255, .1);
  --facet-shadow:
    inset 0 7px 9px -6px rgba(255, 255, 255, .55),
    inset 6px 0 9px -6px rgba(255, 255, 255, .35),
    inset 0 -6px 9px -6px rgba(255, 255, 255, .22),
    inset -6px 0 9px -6px rgba(255, 255, 255, .26),
    inset 0 0 14px rgba(255, 255, 255, .1),
    0 8px 20px -10px rgba(0, 0, 0, .45);
}
:root[data-theme="dark"] { --facet-glass: rgba(20, 14, 18, .14); }
.cover-stack .glass-brick,
.cover-stack .cover-actions .btn, .cover-stack .cover-actions .btn.ghost,
.cover-top .hero-count, .cover-top .hero-x,
:root[data-theme="dark"] .cover-stack .glass-brick,
:root[data-theme="dark"] .cover-stack .cover-actions .btn,
:root[data-theme="dark"] .cover-top .hero-count, :root[data-theme="dark"] .cover-top .hero-x {
  background: var(--facet-glass);
  box-shadow: var(--facet-shadow);
}
.cover-stack .cover-actions .btn:not(.ghost),
:root[data-theme="dark"] .cover-stack .cover-actions .btn:not(.ghost) { background: rgba(255, 170, 210, .2); }
.hero-cover .heart-btn.heart-corner {
  background: var(--facet-glass);
  box-shadow: var(--facet-shadow) !important;
}

/* На главной у избранных — такая же стеклянная капля с красным сердцем (только значок) */
.poster-fav.heart-mark {
  top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0;
  background: var(--facet-glass); box-shadow: var(--facet-shadow);
  -webkit-backdrop-filter: blur(6px) saturate(150%) brightness(.92);
  backdrop-filter: blur(6px) saturate(150%) brightness(.92);
}
.poster-fav.heart-mark img {
  width: 21px; height: 21px; object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(255, 40, 60, .85)) drop-shadow(0 0 6px rgba(220, 0, 30, .55));
}

/* ---------- Шаг 3о: свечение красного сердца без «квадрата». Тень на картинке обрезалась
   её рамкой (clip-path) и давала квадрат — теперь мягкий ореол у самых краёв сердца
   рисуется на обёртке, которую ничего не обрезает. ---------- */
.heart-btn .heart-img, .heart-btn .heart-img.blood,
.heart-btn.on .heart-img.blood { filter: none; }
.heart-btn .heart-box { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); transition: filter .6s; }
.heart-btn.on .heart-box {
  filter: drop-shadow(0 0 1.5px rgba(255, 50, 70, .75)) drop-shadow(0 0 3px rgba(200, 0, 30, .35));
}
.poster-fav.heart-mark img { filter: drop-shadow(0 0 1.5px rgba(255, 50, 70, .75)) drop-shadow(0 0 3px rgba(200, 0, 30, .35)); }

.hero-cover .heart-btn.heart-corner, .hero-cover .heart-btn.heart-corner.on { filter: none; }

/* ---------- Шаг 3п: шрифт в стеклянном блоке плотнее; на светлой обложке текст тёмный ---------- */
.hero.bare .cover-stack .glass-brick .hero-title { font-weight: 800; letter-spacing: .01em; }
.hero.bare .cover-stack .glass-brick .byline,
.hero.bare .cover-stack .glass-brick .meta,
.hero.bare .cover-stack .glass-brick .hero-chapter,
.hero.bare .cover-stack .glass-brick .hero-notes { font-size: 12.5px; font-weight: 500; letter-spacing: .02em; }
.hero.bare .cover-stack .glass-brick .hero-label { font-weight: 700; letter-spacing: .08em; }

/* светлая обложка: тёмно-сливовый текст со светлым ореолом */
.hero.bare .light-cover .cover-stack .glass-brick .hero-title,
.hero.bare .light-cover .cover-stack .glass-brick .byline,
.hero.bare .light-cover .cover-stack .glass-brick .meta,
.hero.bare .light-cover .cover-stack .glass-brick .hero-chapter,
.hero.bare .light-cover .cover-stack .glass-brick .hero-notes,
.hero.bare .light-cover .cover-stack .cover-actions .btn,
.hero.bare .light-cover .cover-top .hero-count, .hero.bare .light-cover .cover-top .hero-x {
  color: #3a1430;
  text-shadow: 0 0 6px rgba(255, 255, 255, .85), 0 0 1px rgba(255, 255, 255, .9);
}
.hero.bare .light-cover .cover-stack .glass-brick .hero-label,
.hero.bare .light-cover .cover-stack .glass-brick .where { color: #a3245e; text-shadow: 0 0 6px rgba(255, 255, 255, .85); }
.hero.bare .light-cover .cover-stack .glass-brick .progress { background: rgba(80, 20, 60, .2); }
.hero.bare .light-cover .cover-stack .glass-brick .progress-fill { background: #b2397a; }
/* стекло на светлой обложке чуть светлее, а не темнее */
.hero.bare .light-cover .cover-stack .glass-brick,
.hero.bare .light-cover .cover-stack .cover-actions .btn {
  -webkit-backdrop-filter: blur(7px) saturate(150%) brightness(1.05);
  backdrop-filter: blur(7px) saturate(150%) brightness(1.05);
}

.light-cover .heart-btn:not(.on) .heart-box { filter: drop-shadow(0 0 1px rgba(70, 15, 50, .9)) drop-shadow(0 1px 2px rgba(70, 15, 50, .5)); }
