/* Онира — Посока А, „Досие край огъня“
   Архивно, разказвателно, топло. Жаравата е светлина, не декорация. */

:root {
  --bg:        #070605;
  --card:      #0a0908;
  --surface:   #0c0806;
  --surface-2: #100b08;
  --raise:     #17100b;

  --line:      #241d18;
  --line-soft: #1c1611;
  --line-hair: #17110c;
  --line-warm: #2a2119;
  --line-mid:  #3a2f26;

  --text:      #ece7df;
  --text-2:    #ded5c7;
  --text-3:    #c8bfb1;
  --muted:     #b5a892;
  --muted-2:   #9c8d7c;
  --muted-3:   #8a7a68;
  --muted-4:   #7d6f5e;
  --dim:       #6b5d4e;
  --dim-2:     #5f5346;

  --ember:     #d4703a;
  --ember-lit: #e0824a;
  --free:      #7fc47f;
  --free-line: #2f5a2f;
  --warn-line: #6b3a22;

  --display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --player-h: 88px;
  --gut: clamp(18px, 4.6vw, 56px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* Всяко `display` в таблицата бие браузърското [hidden] { display: none }.
   Затова скриването се налага веднъж, тук, вместо да се кърпи на всяко
   място поотделно — вече веднъж се върна така. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--ember); color: var(--card); }

main, .sitefoot { max-width: 1240px; margin-inline: auto; }

/* ── шапка ─────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  max-width: 1240px; margin-inline: auto;
  padding: 20px var(--gut);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: block;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand-logo {
  width: 112px;
  height: auto;
}

.topnav {
  display: flex; align-items: center; gap: clamp(14px, 2.6vw, 34px);
  font-size: 14px;
}
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--text); }

/* ── бутони ────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex; align-items: center; gap: 11px;
  background: var(--ember); color: var(--card);
  border: 0; border-radius: 8px;
  padding: 15px 28px;
  font-size: 16px; font-weight: 600;
  transition: background .15s, transform .12s;
}
.btn-primary:hover { background: var(--ember-lit); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary.sm { padding: 9px 18px; font-size: 14px; border-radius: 6px; }
.btn-primary.wide { width: 100%; justify-content: center; }

.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-mid); border-radius: 8px;
  padding: 15px 24px; font-size: 15px;
  transition: border-color .15s;
}
.btn-ghost:hover { border-color: var(--dim); }

/* Шапката е лепкава, затова котвите спират под нея, а не зад нея.
   Височината идва измерена от app.js — зависи от логото и от ширината,
   а сбъркана с няколко пиксела значи заглавие зад шапката. */
.hero, .library, .seasons {
  scroll-margin-top: calc(var(--topbar-h, 94px) + 14px);
}

/* ── герой ─────────────────────────────────────────────── */

.hero {
  display: grid;
  justify-items: center;
  gap: clamp(24px, 3.4vw, 38px);
  padding: clamp(40px, 5.4vw, 68px) var(--gut) clamp(36px, 4.4vw, 52px);
  border-bottom: 1px solid var(--line-soft);

  /* Снимката е атмосфера, не сюжет. Тъмно в средата, под текста;
     жаравата остава да тлее по краищата. */
  background:
    radial-gradient(96% 86% at 50% 42%,
      rgba(7, 6, 5, .95) 0%,
      rgba(7, 6, 5, .86) 48%,
      rgba(7, 6, 5, .68) 100%),
    url(img/hero-wide.jpg) center / cover no-repeat,
    var(--card);
}

/* Двете корици лежат една върху друга и се преливат кръстосано —
   така никога няма кадър, в който няма нищо. */
.hero-art {
  position: relative;
  width: min(340px, 68vw);
  aspect-ratio: 1;
  border-radius: 8px;
  box-shadow: 0 30px 60px -20px #000, 0 0 0 1px var(--line-warm);
  overflow: hidden;
}

.hero-art img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 1; transform: scale(1);
  transition:
    opacity 900ms cubic-bezier(.4, 0, .2, 1),
    transform 1700ms cubic-bezier(.22, 1, .36, 1);
  will-change: opacity, transform;
}

/* Скритата стои леко отдалечена; при излизане напред се прибира
   до мащаб 1 и това дава дишането, което липсваше. */
.hero-art img.is-back { opacity: 0; transform: scale(1.045); }

@media (prefers-reduced-motion: reduce) {
  .hero-art img { transition: opacity 200ms linear; transform: none; }
  .hero-art img.is-back { transform: none; }
}

.hero-body { max-width: 680px; }

.eyebrow {
  margin: 0 0 20px;
  font-size: 12px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--muted-3);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.03;
  letter-spacing: -.01em;
  margin: 0 0 22px;
  text-wrap: pretty;
}

.hero-desc {
  font-size: 17px; line-height: 1.7; color: var(--text-3);
  max-width: 560px; margin: 0 0 24px;
  text-wrap: pretty;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin: 0 0 32px;
  font-size: 14px; color: var(--muted-2);
}
.hero-meta i { font-style: normal; color: var(--line-mid); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ── библиотека: всички заглавия ────────────────────────── */

.library {
  padding: clamp(32px, 4vw, 44px) var(--gut) clamp(12px, 2vw, 20px);
  border-bottom: 1px solid var(--line-soft);
}

.library-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.library-head .section-title { margin: 0; }
.library-stats { margin: 0; font-size: 13px; color: var(--muted-4); }

.titles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
}

.card {
  position: relative;
  background: none; border: 0; padding: 0;
  text-align: left; width: 100%;
}
.card-art {
  aspect-ratio: 1; border-radius: 8px;
  background-color: var(--surface);
  background-size: cover; background-position: center;
  box-shadow: 0 0 0 1.5px var(--line);
  opacity: .62;
  transition: opacity .18s, box-shadow .18s, transform .18s;
}
.card:hover .card-art { opacity: .9; transform: translateY(-2px); }
.card.is-current .card-art {
  opacity: 1; box-shadow: 0 0 0 1.5px var(--ember);
}
.card:focus-visible .card-art {
  outline: 2px solid var(--ember); outline-offset: 3px;
}

.card-name {
  margin-top: 11px; font-size: 14.5px; color: var(--text-3);
  line-height: 1.3;
}
.card.is-current .card-name { color: var(--text); }
.card-meta { margin-top: 3px; font-size: 12px; color: var(--muted-4); }
.card-author { margin-top: 2px; font-size: 13px; color: var(--muted-3, var(--muted-4)); }

.card-flag {
  position: absolute; top: 9px; left: 9px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  font-size: 9px;
}
.card.is-hidden-title .card-art { opacity: .42; }
.card.is-hidden-title:hover .card-art { opacity: .7; }

/* ── каталог ───────────────────────────────────────────── */

.seasons { padding: clamp(32px, 4vw, 44px) var(--gut) clamp(44px, 5vw, 56px); }

.section-title {
  font-family: var(--display); font-weight: 400;
  font-size: 26px; margin: 0 0 22px;
}

.shelf {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}

.shelf button {
  background: none; border: 0; padding: 0; text-align: left;
  display: block; width: 100%;
}
.shelf .art {
  aspect-ratio: 1; border-radius: 8px;
  background-color: var(--surface); background-size: cover; background-position: center;
  box-shadow: 0 0 0 1.5px var(--line);
  opacity: .55;
  transition: opacity .18s, box-shadow .18s;
}
.shelf button:hover .art { opacity: .8; }
.shelf button[aria-selected="true"] .art {
  opacity: 1; box-shadow: 0 0 0 1.5px var(--ember);
}
.shelf .label {
  font-size: 12px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--muted-3); margin-top: 10px;
}
.shelf button[aria-selected="true"] .label { color: var(--text-3); }
.shelf button:focus-visible .art { outline: 2px solid var(--ember); outline-offset: 3px; }

.season-title {
  font-family: var(--display); font-style: italic;
  font-size: 18px; color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: 24px; margin: 0 0 8px;
}

/* ── епизоди ───────────────────────────────────────────── */

.episodes { list-style: none; margin: 0; padding: 0; }

.ep {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 20px; align-items: center;
  padding: 16px 8px;
  border-bottom: 1px solid var(--line-hair);
  cursor: pointer;
  transition: background .13s;
}
.ep:hover { background: var(--surface-2); }
.ep:focus-visible { outline: 2px solid var(--ember); outline-offset: -2px; }

.ep-num {
  font-family: var(--display); font-size: 22px;
  color: var(--dim-2); text-align: center;
  font-variant-numeric: tabular-nums;
}
.ep.playing .ep-num { color: var(--ember); }

.ep-head {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 5px;
}
.ep-name { font-size: 16px; color: var(--text); }
.ep.playing .ep-name { color: var(--ember); }
.ep-dur { font-size: 13px; color: var(--muted-4); }

.tag {
  font-size: 10px; letter-spacing: .14em;
  padding: 2px 7px; border-radius: 4px; border: 1px solid;
  white-space: nowrap;
}
.tag.free { color: var(--free); border-color: var(--free-line); }
.tag.warn { color: var(--ember-lit); border-color: var(--warn-line); letter-spacing: .1em; }

.ep-progress {
  margin-top: 9px; height: 3px; width: 220px; max-width: 60%;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
.ep-progress i { display: block; height: 100%; background: var(--ember); }

.ep-go {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-mid);
  display: grid; place-items: center;
  color: var(--ember); font-size: 13px;
  transition: border-color .15s, background .15s;
}
.ep:hover .ep-go { border-color: var(--ember); background: rgba(212, 112, 58, .08); }
.ep.locked .ep-name { color: var(--muted-2); }
.ep.locked .ep-go { color: var(--muted-4); }

/* ── подвал ────────────────────────────────────────────── */

.sitefoot {
  border-top: 1px solid var(--line-soft);
  padding: 32px var(--gut) 44px;
  color: var(--muted-4); font-size: 13px;
}
.sitefoot p { margin: 0 0 7px; }
.foot-logo {
  width: 104px;
  height: auto;
  margin-bottom: 14px;
  opacity: .72;
}
.fine { font-size: 12px; color: var(--dim); }

/* ── плейър ────────────────────────────────────────────── */

.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.player-body {
  display: flex; align-items: center; gap: clamp(12px, 2vw, 26px);
  max-width: 1240px; margin-inline: auto;
  padding: 14px var(--gut);
  min-height: calc(var(--player-h) - 12px);
}

.play {
  width: 56px; height: 56px; flex: none;
  border-radius: 50%; border: 0;
  background: var(--ember); color: var(--card);
  display: grid; place-items: center;
  transition: background .15s, transform .12s;
}
.play:hover { background: var(--ember-lit); }
.play:active { transform: scale(.95); }
.play > svg { grid-area: 1 / 1; }
.play #ic-pause { display: none; }
.play.is-playing #ic-play { display: none; }
.play.is-playing #ic-pause { display: block; }

.player-skip { display: flex; gap: 14px; flex: none; }
.player-skip button {
  background: none; border: 0; padding: 4px 2px;
  color: var(--text-3); font-size: 13px;
  white-space: nowrap;
}
.player-skip button:hover { color: var(--text); }

.player-now {
  display: flex; align-items: center; gap: 12px;
  min-width: 0; flex: 0 1 240px;
}
.player-now img {
  width: 46px; height: 46px; flex: none;
  border-radius: 5px; box-shadow: 0 0 0 1px var(--line-warm);
}
.player-text { display: flex; flex-direction: column; min-width: 0; }
.player-title {
  font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-sub { font-size: 12px; color: var(--muted-4); }

.player-track { flex: 1 1 auto; min-width: 120px; }

#seek {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 12px; background: transparent; cursor: pointer;
  display: block;
}
#seek::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(to right,
    var(--ember) var(--pct, 0%), var(--line) var(--pct, 0%));
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--ember); margin-top: -4px;
  opacity: 0; transition: opacity .15s;
}
.player:hover #seek::-webkit-slider-thumb { opacity: 1; }
#seek::-moz-range-track { height: 5px; background: var(--line); border-radius: 3px; }
#seek::-moz-range-progress { height: 5px; background: var(--ember); border-radius: 3px; }
#seek::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--ember); }

.player-times {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted-4);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

.player-right { display: flex; gap: 12px; flex: none; }

.chip {
  background: transparent; border: 1px solid var(--line-mid);
  border-radius: 6px; padding: 7px 12px;
  font-size: 13px; color: var(--muted);
  white-space: nowrap;
  transition: color .13s, border-color .13s;
}
.chip:hover { color: var(--text); border-color: var(--dim); }
.chip.on { color: var(--ember); border-color: var(--warn-line); }

.sleep-menu {
  position: absolute; right: var(--gut); bottom: calc(100% - 6px);
  background: var(--raise); border: 1px solid var(--line-warm);
  border-radius: 12px; padding: 6px; min-width: 184px;
  box-shadow: 0 18px 44px -12px #000;
}
.sleep-menu button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 8px;
  padding: 10px 13px; font-size: 14px; color: var(--text-2);
}
.sleep-menu button:hover { background: var(--surface-2); }

/* ── модал ─────────────────────────────────────────────── */

.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(5, 4, 3, .8);
  backdrop-filter: blur(6px);
  padding: 20px;
  overflow-y: auto;
}

.modal-card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line-warm);
  border-radius: 14px;
  padding: clamp(26px, 4vw, 38px);
  width: min(100%, 460px);
  box-shadow: 0 40px 90px -30px #000;
}
.modal-card h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(24px, 3.4vw, 32px); line-height: 1.12;
  margin: 0 0 14px; text-wrap: pretty;
}
.modal-lead { margin: 0 0 22px; color: var(--text-3); font-size: 15px; }

.modal-x {
  position: absolute; top: 12px; right: 14px;
  background: transparent; border: 0; color: var(--muted-4);
  font-size: 26px; line-height: 1; padding: 4px 8px;
}
.modal-x:hover { color: var(--text); }

.perks {
  list-style: none; margin: 0 0 26px; padding: 0;
  display: flex; flex-direction: column; gap: 13px;
}
.perks li {
  display: grid; grid-template-columns: 16px 1fr; gap: 12px;
  font-size: 14.5px; color: var(--text-2);
}
.perks li::before { content: "—"; color: var(--ember); }

.price { display: flex; align-items: baseline; gap: 9px; margin-bottom: 4px; }
.price b { font-family: var(--display); font-size: 46px; font-weight: 400; }
.price span { color: var(--muted); font-size: 16px; }
#price-note { margin: 0 0 22px; }

.field { display: block; margin-bottom: 14px; }
.field span {
  display: block; font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted-3); margin-bottom: 7px;
}
.field input {
  width: 100%; font: inherit; font-size: 15px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-mid); border-radius: 8px;
  padding: 13px 14px;
}
.field input:focus { outline: none; border-color: var(--ember); }

#paywall-note { text-align: center; margin: 16px 0 0; letter-spacing: .06em; }

/* ── известия ──────────────────────────────────────────── */

.toast {
  position: fixed; z-index: 70;
  left: 50%; bottom: calc(var(--player-h) + 24px);
  transform: translate(-50%, 14px);
  background: var(--raise); color: var(--text);
  border: 1px solid var(--line-warm); border-radius: 999px;
  padding: 11px 22px; font-size: 14px;
  box-shadow: 0 16px 40px -12px #000;
  opacity: 0; transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }

/* ── малки екрани ──────────────────────────────────────── */

@media (max-width: 940px) {
  .hero {
    /* Тесният кадър при изправен екран. */
    background:
      radial-gradient(120% 76% at 50% 44%,
        rgba(7, 6, 5, .95) 0%,
        rgba(7, 6, 5, .88) 52%,
        rgba(7, 6, 5, .74) 100%),
      url(img/hero-tall.jpg) center top / cover no-repeat,
      var(--card);
  }
  .player-now { display: none; }
}

@media (max-width: 720px) {
  :root { --player-h: 82px; }
  .brand-logo { width: 94px; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Шапката се цепеше на два реда — по-стегната разредка я побира. */
  .eyebrow { letter-spacing: .18em; margin-bottom: 16px; }

  /* Дългият надпис се пренасяше през иконата. Опашката пада,
     а бутонът заема реда си целия. */
  .cta-tail { display: none; }
  .hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .hero-actions button { width: 100%; justify-content: center; }
  .player-right, .player-skip { display: none; }
  .player-body { gap: 14px; }
  .play { width: 50px; height: 50px; }
  .ep { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 14px 4px; }
  .ep-num { font-size: 18px; }
  .ep-name { font-size: 15px; }
  .ep-go { width: 32px; height: 32px; font-size: 11px; }
  .topnav a[href="#catalog"] { display: none; }
}

/* ── ONIRA: a listening-first library ──────────────────── */
:root { --nav-h: 72px; --player-h: 76px; }
body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); }
body.has-player { padding-bottom: calc(var(--nav-h) + var(--player-h) + env(safe-area-inset-bottom) + 24px); }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ember-lit); outline-offset: 4px; }
a { color: inherit; }
.page-view { padding: 36px var(--gut) 64px; min-height: 65vh; }
.page-heading { margin: 12px 0 36px; max-width: 760px; }
.page-heading h1, .author-hero h1 { font: 400 clamp(34px,5vw,62px)/1.12 var(--display); margin: 0 0 18px; }
.page-heading p:not(.eyebrow) { color: var(--muted); max-width: 560px; }
.page-heading .eyebrow { color: var(--ember-lit); }
.icon-button { border: 1px solid var(--line-mid); background: none; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); font-size: 20px; }
.text-button { background: none; border: none; padding: 9px 0; color: var(--ember-lit); font-size: 14px; text-align: left; }
.text-button:hover { color: var(--text); }
.bottom-nav { position: fixed; z-index: 45; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: color-mix(in srgb,var(--bg) 95%,transparent); backdrop-filter: blur(20px); border-top: 1px solid var(--line-warm); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { width: min(220px,33.333%); min-height: var(--nav-h); display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted-2); text-decoration: none; font-size: 13px; }
.bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
/* Без линия отгоре: там е напредъкът на мини плейъра и двете се сливаха. */
.bottom-nav a[aria-current] { color: var(--ember-lit); }
.continue-section { margin-bottom: 44px; }
.has-resume .page-heading { display: none; }
.continue-card, .welcome-card { padding: clamp(18px,3vw,32px); border: 1px solid var(--line-mid); border-radius: 16px; background: radial-gradient(ellipse at 0% 0%,#44251460,transparent 75%),var(--surface-2); }
.continue-card { display: grid; grid-template-columns: minmax(100px,180px) 1fr; align-items: center; gap: 28px; }
.continue-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.continue-card h3 { margin: 0 0 8px; font: 400 28px/1.2 var(--display); }
.continue-card p { color: var(--muted); margin: 8px 0 14px; }
progress { accent-color: var(--ember); width: 100%; height: 4px; border: 0; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--ember); }
progress::-moz-progress-bar { background: var(--ember); }
.continue-card progress { max-width: 420px; display: block; }
.welcome-card p { margin-top: 0; color: var(--text-3); }
.home-shelf { margin-bottom: 42px; }
.topic-intro { color: var(--muted); margin: -12px 0 22px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 16px; }
.topic-card { display: flex; flex-direction: column; padding: 24px; overflow: hidden; text-decoration: none; border: 1px solid var(--line-mid); border-radius: 14px; background: var(--surface-2); transition: border-color .18s,transform .18s; }
.topic-art { display: block; width: calc(100% + 48px); max-width: none; height: auto; aspect-ratio: 5 / 3; object-fit: cover; flex: none; margin: -24px -24px 22px; }
.topic-card:hover { border-color: var(--ember); transform: translateY(-2px); }
.topic-symbol { font: 34px/1 var(--display); color: var(--ember-lit); margin-bottom: 18px; }
.topic-symbol.topic-art-ph { display: flex; align-items: center; justify-content: center; width: calc(100% + 48px); aspect-ratio: 5 / 3; margin: -24px -24px 22px; font-size: 72px; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--ember) 22%, transparent), transparent 70%), var(--surface-3, var(--surface-2)); border-bottom: 1px solid var(--line-mid); }
.topic-card h3 { font: 400 24px/1.2 var(--display); margin: 0 0 10px; }
.topic-card p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.topic-count { color: var(--ember-lit); font-size: 12px; margin-top: auto; }
.shelf-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.shelf-heading h2 { margin: 0; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(155px,20vw,210px); gap: 20px; overflow-x: auto; padding: 4px 2px 18px; scrollbar-width: thin; scrollbar-color: var(--line-mid) transparent; scroll-snap-type: x proximity; }
.shelf-row .card { scroll-snap-align: start; }
.card { min-width: 0; position: relative; }
.completion-toggle { position: absolute; top: 4px; left: 4px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #111b; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.completion-toggle[aria-pressed="false"] { opacity: 0; }
.completion-toggle[aria-pressed="false"]::after { content: ''; display: block; margin: auto; width: 17px; height: 17px; border: 1px solid currentColor; border-radius: 3px; }
.card:hover .completion-toggle, .completion-toggle:focus-visible { opacity: 1; }
.completion-toggle:focus-visible { outline: 2px solid var(--ember-lit); outline-offset: 2px; }
@media (hover: none) { .completion-toggle[aria-pressed="false"] { opacity: .6; } }
.card-open { text-decoration: none; display: block; border-radius: 8px; }
.card-art { width: 100%; height: auto; object-fit: cover; opacity: 1; }
/* Корицата носи етикета „Ново“ / „Изслушано“ и лентата докъде е чуто. */
.card-cover { position: relative; display: block; border-radius: 8px; overflow: hidden; }
.card-cover .card-art { display: block; }
.card-badge {
  position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em; line-height: 1.4;
  backdrop-filter: blur(6px);
}
.card-badge.is-new { background: var(--ember); color: #1a0f08; }
.card-badge.is-done { background: color-mix(in srgb, var(--bg) 78%, transparent); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-warm); }
.card-heard { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.card-heard::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--pct); background: var(--ember); }
.card-name { display: block; color: var(--text-2); font-weight: 500; }
.card-meta { margin-bottom: 0; color: var(--muted-2); }
.card .author-link { display: inline-block; font-size: 12px; margin: 5px 0 0; color: var(--muted); }
.author-link { color: var(--ember-lit); text-decoration: none; }
.author-link:hover { text-decoration: underline; }
.hero-body > .author-link { display: inline-block; margin: -4px 0 18px; }
.hero { grid-template-columns: minmax(220px,340px) minmax(0,1fr); justify-items: start; align-items: center; background: linear-gradient(115deg,#20130b66,transparent 70%),var(--bg); }
.hero-art { width: 100%; max-width: 340px; }
.hero h1 { font-size: clamp(32px,4vw,52px); margin-bottom: 18px; }
.hero-body { min-width: 0; }
.hero-desc { font-size: 15px; margin-bottom: 16px; }
.hero-desc.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#description-more { margin: -12px 0 16px; }
.hero-actions { gap: 10px; }
.hero-actions .btn-primary, .hero-actions .btn-ghost { padding: 12px 18px; font-size: 14px; }
.hero-meta { gap: 12px; font-size: 13px; margin-bottom: 22px; }
.hero-actions #hero-subscribe { order: 4; }
.hero-actions #save-title { order: 2; }
.hero-actions #share-title { order: 3; }
.catalog-filters { margin-bottom: 28px; }
.search-field { display: block; max-width: 720px; }
.search-field > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.search-field input { width: 100%; background: var(--surface-2); color: var(--text); padding: 16px 18px; border: 1px solid var(--line-mid); border-radius: 12px; font: inherit; }
.filter-row { margin-top: 18px; display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.filter-row label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; }
select { font: inherit; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-mid); padding: 10px 12px; border-radius: 8px; max-width: 100%; }
.filter-row .free-filter { flex-direction: row; align-items: center; min-height: 42px; gap: 8px; }
input[type=checkbox] { accent-color: var(--ember); width: 18px; height: 18px; }
.empty-state { text-align: center; border: 1px dashed var(--line-mid); border-radius: 12px; padding: 40px 24px; color: var(--muted); margin-top: 24px; }
.empty-state h2 { color: var(--text-2); font: 400 26px var(--display); }
.empty-state .btn-primary { margin-top: 12px; }
.library-tabs { display: flex; gap: 12px; margin-bottom: 26px; }
.author-hero { display: grid; grid-template-columns: minmax(200px,390px) 1fr; gap: 40px; align-items: center; margin: 10px 0 48px; }
.author-hero img { border-radius: 12px; width: 100%; aspect-ratio: 1; object-fit: cover; }
.author-hero p:not(.eyebrow) { color: var(--muted); }
.author-hero:has(img[hidden]) { grid-template-columns: 1fr; }
.locked-tag { color: var(--muted); border-color: var(--line-mid); font-size: 9px; }
.ep[aria-current=step] { background: #d4703a0b; border-left: 2px solid var(--ember); }
.ep[aria-current=step] .ep-name::after { content: ' · Продължи'; color: var(--ember-lit); font-size: 12px; }
.ep.playing[aria-current=step] .ep-name::after { content: ' · Текущ запис'; }
.settings-dialog { width: min(440px,calc(100vw - 32px)); padding: 32px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-mid); border-radius: 16px; }
.settings-dialog::backdrop { background: #000b; backdrop-filter: blur(6px); }
.settings-dialog h2 { font: 400 30px var(--display); }
.settings-field { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; font-size: 14px; }
.settings-field:has(input) { justify-content: start; }
.settings-dialog .fine { line-height: 1.7; }
.player { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0; border-radius: 14px 14px 0 0; }
.player-body { min-height: var(--player-h); padding: 10px var(--gut); gap: 16px; }
.player-now { display: flex; flex: 1 1 auto; padding: 0; border: 0; background: none; text-align: left; }
.player-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 30px; }
.player:not(.expanded) .play { width: 46px; height: 46px; background: none; color: var(--ember-lit); border: 1px solid var(--line-mid); }
.player:not(.expanded) .player-track, .player:not(.expanded) .player-right, .player:not(.expanded) .skip-control, .player:not(.expanded) #player-chapters { display: none; }
#mini-progress { position: absolute; bottom: 0; left: 0; margin: 0; height: 2px; }
.player.expanded #mini-progress { display: none; }
body.player-open { overflow: hidden; }
.player.expanded { z-index: 55; inset: 0; border: 0; border-radius: 0; background: var(--bg); overflow-y: auto; padding-bottom: max(32px,env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.player.expanded .player-body { display: flex; flex-direction: column; max-width: 600px; padding: 18px 28px 40px; gap: 22px; }
#player-collapse { align-self: flex-start; min-height: 44px; }
.player-large-cover { width: min(36vh,330px); aspect-ratio: 1; object-fit: cover; border-radius: 12px; box-shadow: 0 20px 60px #0008; }
.player.expanded .player-now { flex: none; text-align: center; justify-content: center; width: 100%; pointer-events: none; }
.player.expanded .player-now img { display: none; }
.player.expanded .player-title { font: 400 26px/1.2 var(--display); white-space: normal; }
.player.expanded .player-sub { margin-top: 8px; font-size: 13px; }
.player.expanded .player-track { order: 2; width: 100%; }
.player.expanded .player-controls { order: 3; width: 100%; }
.player.expanded .player-right { order: 4; display: flex; justify-content: center; flex-wrap: wrap; }
.player.expanded .play { width: 72px; height: 72px; }
.player.expanded .skip-control { display: flex; align-items: center; gap: 2px; font-size: 32px; background: none; border: 0; padding: 10px; color: var(--text-3); min-height: 52px; }
.skip-control small { font-size: 14px; }
.player.expanded #player-chapters { order: 5; width: 100%; }
.player-chapter { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 6px; font-size: 14px; }
.player-chapter[aria-current] { color: var(--ember-lit); }
.player.expanded .sleep-menu { position: fixed; bottom: 20px; z-index: 2; max-height: 70vh; overflow: auto; }
.toast { bottom: calc(var(--nav-h) + var(--player-h) + 20px + env(safe-area-inset-bottom)); }
@media (min-width: 1000px) { #home-view .page-heading { margin-top: 26px; } .titles { grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); } }
@media (max-width: 720px) {
  .topbar { padding: 14px var(--gut); gap: 12px; }
  .topnav { gap: 12px; }
  .topnav .btn-primary.sm { padding: 10px 12px; font-size: 12px; }
  .page-view { padding-top: 26px; }
  .page-heading h1 { font-size: 38px; }
  .bottom-nav a { flex-direction: column; gap: 4px; font-size: 11px; }
  .hero { display: flex; flex-direction: column; align-items: stretch; padding-top: 26px; gap: 26px; }
  .hero-art { align-self: center; width: min(72vw,320px); }
  .hero h1 { font-size: 36px; }
  .hero-actions { display: flex; flex-wrap: wrap; }
  .hero-actions #play-first { width: 100%; }
  .hero-actions #save-title { flex: 1; width: auto; }
  .hero-actions #share-title { width: auto; }
  .hero-actions #hero-subscribe { width: 100%; }
  .section-title { font-size: 24px; }
  .shelf-heading .text-button { font-size: 12px; white-space: nowrap; }
  .shelf-row { grid-auto-columns: 155px; gap: 16px; }
  .continue-card { grid-template-columns: 90px minmax(0,1fr); gap: 18px; padding: 18px; align-items: start; }
  .continue-card h3 { font-size: 23px; }
  .continue-card p { font-size: 12px; }
  .continue-card .btn-primary { padding: 12px 20px; }
  .author-hero { grid-template-columns: 1fr; gap: 24px; }
  .author-hero img { max-width: 350px; }
  .filter-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .filter-row label { min-width: 0; }
  .filter-row .free-filter { grid-column: 1 / -1; }
  .player-now { display: flex; }
  .player-now img { width: 44px; height: 44px; }
  .player-title { font-size: 13px; }
  .player-body { gap: 10px; }
  .player.expanded .player-right { display: flex; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; } }

/* 12 категории на телефон: две колони, компактни карти, без описанието
   (името и броят стигат), за да не са четири екрана превъртане. */
@media (max-width: 600px) {
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .topic-card { padding: 14px; border-radius: 12px; }
  .topic-card .topic-art, .topic-symbol.topic-art-ph { width: calc(100% + 28px); margin: -14px -14px 12px; }
  .topic-symbol.topic-art-ph { font-size: 44px; }
  .topic-card h3 { font-size: 17px; margin-bottom: 6px; }
  .topic-card p { display: none; }
  .topic-card .topic-count { font-size: 12px; margin-top: auto; }
}
