/* ============================================
   KNIGISM v3 — на основе V1, чуть светлее
   + максимальный mobile-фокус.
   Тёмная тема (на 25-40% светлее v1), жёлто-красные акценты, glow.
   ============================================ */

:root {
  /* surfaces — чуть светлее v1 */
  --c-bg:        #16161c;
  --c-bg-2:      #1e1e26;
  --c-bg-3:      #282832;
  --c-bg-4:      #34343f;
  --c-border:    rgba(255,255,255,0.09);
  --c-border-2:  rgba(255,255,255,0.16);

  /* text */
  --c-text:      #f7f7f9;
  --c-text-2:    #c4c4c9;
  --c-text-3:    #8d8d95;
  --c-text-4:    #5c5c64;

  /* accents — те же, но чуть мягче для светлого фона */
  --c-yellow:    #ffd60a;
  --c-yellow-2:  #ffb800;
  --c-orange:    #ff8a00;
  --c-red:       #ff4133;
  --c-red-2:     #d11a10;
  --c-white:     #ffffff;

  /* signal */
  --c-success:   #34c759;
  --c-info:      #5ac8fa;

  /* gradients */
  --g-fire:        linear-gradient(135deg, #ffd60a 0%, #ff8a00 50%, #ff3b30 100%);
  --g-fire-soft:   linear-gradient(135deg, rgba(255,214,10,.20) 0%, rgba(255,138,0,.20) 50%, rgba(255,59,48,.20) 100%);
  --g-dark:        linear-gradient(180deg, #16161c 0%, #22222a 100%);
  --g-card:        linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
  --g-glass:       linear-gradient(180deg, rgba(30,30,38,.85) 0%, rgba(22,22,28,.7) 100%);
  --g-glow-yellow: radial-gradient(60% 60% at 50% 50%, rgba(255,214,10,.40) 0%, transparent 65%);
  --g-glow-red:    radial-gradient(60% 60% at 50% 50%, rgba(255,59,48,.36) 0%, transparent 65%);

  /* radii */
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 30px; --r-full: 9999px;

  /* shadows */
  --s-card:        0 8px 28px rgba(0,0,0,.55), 0 2px 4px rgba(0,0,0,.35);
  --s-card-hover:  0 14px 44px rgba(0,0,0,.65), 0 4px 8px rgba(0,0,0,.35);
  --s-glow-y:      0 0 24px rgba(255,214,10,.40), 0 0 60px rgba(255,138,0,.20);
  --s-glow-r:      0 0 24px rgba(255,59,48,.42), 0 0 60px rgba(255,59,48,.20);
  --s-inset:       inset 0 0 0 1px var(--c-border);

  /* transitions */
  --t-fast:   150ms cubic-bezier(.16,1,.3,1);
  --t-base:   250ms cubic-bezier(.16,1,.3,1);
  --t-slow:   450ms cubic-bezier(.16,1,.3,1);

  /* layout */
  --container:   1280px;
  --gutter:      16px;        /* меньше на мобиле */
  --header-h:    60px;        /* немного компактнее */
  --nav-h-mob:   72px;        /* больше для пальца */
  --tap-min:     48px;        /* минимальная touch-target */
}

@media (min-width: 720px) {
  :root { --gutter: 24px; --header-h: 68px; }
}

/* ============================================
   reset & base
   ============================================ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h-mob) + env(safe-area-inset-bottom, 0px));
  /* отключаем выделение при долгом нажатии — в mobile-friendly UI */
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 900px) { body { padding-bottom: 0; } }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; min-height: var(--tap-min); }
input, textarea, select { font: inherit; }

::selection { background: var(--c-yellow); color: #000; }

/* scrollbar (desktop only) */
@media (min-width: 720px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--c-bg-4); border-radius: var(--r-full); }
  ::-webkit-scrollbar-thumb:hover { background: var(--c-text-4); }
}

/* typography */
h1,h2,h3,h4,h5 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--c-text);
}
h1 { font-size: clamp(26px, 6vw, 44px); }
h2 { font-size: clamp(20px, 4vw, 30px); }
h3 { font-size: clamp(17px, 3vw, 22px); }

/* ============================================
   utilities
   ============================================ */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.row    { display: flex; gap: 12px; }
.col    { display: flex; flex-direction: column; }
.center { display: flex; align-items: center; justify-content: center; }
.between{ display: flex; align-items: center; justify-content: space-between; }

.text-2 { color: var(--c-text-2); }
.text-3 { color: var(--c-text-3); }
.text-gradient {
  background: var(--g-fire);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* секции */
.section { padding: 36px 0; }
@media (min-width: 720px) { .section { padding: 56px 0; } }

.section__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px;
}
@media (min-width: 720px) { .section__head { margin-bottom: 24px; } }
.section__head h2 { display: flex; align-items: center; gap: 10px; }
.section__head .all-link {
  color: var(--c-text-3); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: var(--r-full);
  background: var(--c-bg-2); border: 1px solid var(--c-border);
  transition: var(--t-base);
  min-height: 40px;
}
.section__head .all-link:hover {
  color: var(--c-yellow); border-color: var(--c-yellow);
  box-shadow: 0 0 0 1px var(--c-yellow), var(--s-glow-y);
}
.section__head .all-link:active { transform: scale(0.96); }

/* ============================================
   buttons
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: var(--r-full);
  font-weight: 600; font-size: 15px;
  transition: var(--t-base);
  cursor: pointer; user-select: none;
  white-space: nowrap;
  min-height: var(--tap-min);
  position: relative;
}
.btn:active { transform: scale(0.96); }
.btn--primary {
  background: var(--g-fire); color: #000;
  box-shadow: var(--s-glow-y);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--s-glow-r), 0 12px 32px rgba(255,138,0,.4); }
.btn--primary:active { transform: scale(0.96); }
.btn--ghost {
  background: var(--c-bg-2); color: var(--c-text);
  border: 1px solid var(--c-border-2);
}
.btn--ghost:hover { background: var(--c-bg-3); border-color: var(--c-yellow); color: var(--c-yellow); }
.btn--icon { padding: 12px; aspect-ratio: 1; min-width: var(--tap-min); }
.btn--sm   { padding: 10px 18px; font-size: 13px; min-height: 40px; }
.btn--lg   { padding: 18px 32px; font-size: 17px; min-height: 56px; }
.btn--block { width: 100%; }

/* ============================================
   chip / tag
   ============================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--r-full);
  background: var(--c-bg-2); border: 1px solid var(--c-border);
  font-size: 13px; font-weight: 500; color: var(--c-text-2);
  transition: var(--t-base);
  cursor: pointer; white-space: nowrap;
  min-height: 40px;
}
.chip:active { transform: scale(0.96); }
.chip:hover {
  color: #000; background: var(--c-yellow); border-color: var(--c-yellow);
  box-shadow: var(--s-glow-y);
}
.chip--active {
  color: #000; background: var(--g-fire); border-color: transparent;
  box-shadow: var(--s-glow-y);
}
.chip--ghost { background: transparent; }

/* ============================================
   header (mobile-optimized)
   ============================================ */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(22,22,28,.75);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-bottom: 1px solid var(--c-border);
  transition: var(--t-base);
}
.header.scrolled {
  background: rgba(22,22,28,.95);
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.header__inner { height: 100%; display: flex; align-items: center; gap: 10px; }
@media (min-width: 720px) { .header__inner { gap: 16px; } }

.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Manrope', sans-serif; font-weight: 800;
  font-size: 20px; letter-spacing: -0.03em;
}
@media (min-width: 720px) { .logo { font-size: 22px; } }
.logo__mark {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--g-fire); display: grid; place-items: center;
  color: #000; font-size: 18px;
  box-shadow: var(--s-glow-y);
}
.logo__mark svg { width: 20px; height: 20px; }
.logo__text { color: var(--c-text); }
.logo__text span { color: var(--c-yellow); }

.nav-main { display: none; gap: 4px; margin-left: 16px; }
.nav-main a {
  position: relative;
  padding: 10px 16px; border-radius: var(--r-full);
  font-size: 14px; font-weight: 500; color: var(--c-text-2);
  transition: var(--t-base);
}
.nav-main a:hover { color: var(--c-text); background: var(--c-bg-2); }
.nav-main a.active {
  color: var(--c-yellow);
  background: var(--c-bg-2);
  box-shadow: inset 0 0 0 1px var(--c-yellow);
}
.nav-main a.active::after {
  content: ''; position: absolute; left: 50%; bottom: -3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-yellow); transform: translateX(-50%);
  box-shadow: 0 0 12px var(--c-yellow);
}

.search {
  flex: 1; max-width: 480px; margin: 0 auto;
  position: relative;
  display: none;
}
.search input {
  width: 100%; padding: 10px 16px 10px 44px;
  background: var(--c-bg-2); border: 1px solid var(--c-border);
  border-radius: var(--r-full); color: var(--c-text);
  font-size: 14px; outline: none;
  transition: var(--t-base);
  min-height: 44px;
}
.search input:focus {
  background: var(--c-bg-3); border-color: var(--c-yellow);
  box-shadow: 0 0 0 4px rgba(255,214,10,.15);
}
.search input::placeholder { color: var(--c-text-4); }
.search svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--c-text-3); pointer-events: none;
}

.header__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.header__icon {
  width: var(--tap-min); height: var(--tap-min); border-radius: var(--r-full);
  display: grid; place-items: center;
  color: var(--c-text-2); transition: var(--t-base);
  position: relative;
}
.header__icon:active { transform: scale(0.92); background: var(--c-bg-3); }
.header__icon:hover { background: var(--c-bg-2); color: var(--c-yellow); }
.header__icon svg { width: 22px; height: 22px; }
.header__icon .dot {
  position: absolute; top: 10px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-red);
  box-shadow: 0 0 8px var(--c-red);
}

/* мобильный поиск trigger (отдельная кнопка-иконка для мобилы) */
.header__search-trigger { display: grid; }
.burger { display: grid; }
@media (min-width: 900px) {
  .search { display: block; }
  .nav-main { display: flex; }
  .burger { display: none; }
  .header__search-trigger { display: none; }
}

/* full-screen search overlay (mobile) */
.search-overlay {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(22,22,28,.98); backdrop-filter: blur(20px);
  opacity: 0; visibility: hidden;
  transition: var(--t-base);
  display: flex; flex-direction: column;
  padding: 16px;
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-overlay__head { display: flex; gap: 10px; align-items: center; }
.search-overlay__head input {
  flex: 1; padding: 14px 18px; background: var(--c-bg-2);
  border: 1px solid var(--c-border-2); border-radius: var(--r-full);
  color: var(--c-text); font-size: 16px; outline: none;
  min-height: 52px;
}
.search-overlay__head input:focus { border-color: var(--c-yellow); box-shadow: 0 0 0 4px rgba(255,214,10,.15); }
.search-overlay__body { padding: 20px 0; flex: 1; overflow-y: auto; }
.search-overlay__group { margin-bottom: 28px; }
.search-overlay__group h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--c-text-3); margin-bottom: 12px;
}
.search-overlay__chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================
   mobile bottom nav (с центральной FAB)
   ============================================ */
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  height: calc(var(--nav-h-mob) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(22,22,28,.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--c-border);
  display: flex; align-items: stretch; justify-content: space-around;
}
.bnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--c-text-3); font-size: 10px; font-weight: 600;
  transition: var(--t-base); position: relative;
  min-height: var(--tap-min);
  letter-spacing: 0.02em;
}
.bnav a:active { transform: scale(0.92); }
.bnav a svg { width: 24px; height: 24px; }
.bnav a.active { color: var(--c-yellow); }
.bnav a.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 36px; height: 3px; border-radius: 0 0 var(--r-full) var(--r-full);
  background: var(--g-fire);
  box-shadow: 0 4px 12px rgba(255,214,10,.4);
}
/* центральная FAB кнопка — поиск */
.bnav .bnav__fab {
  flex: 0 0 auto; margin: -22px 6px 0;
  width: 60px; height: 60px; border-radius: var(--r-full);
  background: var(--g-fire); color: #000;
  display: grid; place-items: center;
  box-shadow: var(--s-glow-y);
  transition: var(--t-base);
  position: relative;
}
.bnav .bnav__fab:active { transform: scale(0.92); }
.bnav .bnav__fab svg { width: 26px; height: 26px; }
.bnav .bnav__fab::after { display: none; }
@media (min-width: 900px) { .bnav { display: none; } }

/* ============================================
   mobile drawer
   ============================================ */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: var(--t-base);
}
.drawer-overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; left: 0; z-index: 201;
  width: min(86vw, 340px); height: 100vh;
  background: var(--c-bg-2);
  transform: translateX(-100%);
  transition: var(--t-slow);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--c-border);
}
.drawer.open { transform: translateX(0); }
.drawer__head {
  padding: 18px 20px; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer__nav { padding: 12px 12px; flex: 1; overflow-y: auto; }
.drawer__nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-md);
  color: var(--c-text-2); font-weight: 500;
  transition: var(--t-fast);
  min-height: var(--tap-min);
}
.drawer__nav a:active { transform: scale(0.98); background: var(--c-bg-4); }
.drawer__nav a svg { width: 22px; height: 22px; color: var(--c-text-3); }
.drawer__nav a:hover, .drawer__nav a.active {
  color: var(--c-yellow); background: var(--c-bg-3);
}
.drawer__nav a.active svg { color: var(--c-yellow); }

/* ============================================
   bottom-sheet (mobile-only generic component)
   ============================================ */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: var(--t-base);
}
.sheet-overlay.open { opacity: 1; visibility: visible; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 221;
  max-height: 85vh; overflow-y: auto;
  background: var(--c-bg-2);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  transform: translateY(100%);
  transition: var(--t-slow);
  padding: 12px 16px 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
.sheet.open { transform: translateY(0); }
.sheet::before {
  content: ''; display: block; margin: 0 auto 12px;
  width: 42px; height: 5px; border-radius: var(--r-full);
  background: var(--c-bg-4);
}
.sheet__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
}
.sheet__head h3 { font-size: 18px; }

/* ============================================
   book card
   ============================================ */
.book-card {
  position: relative;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 10px;
  border-radius: var(--r-md);
  transition: var(--t-base);
  cursor: pointer;
  text-decoration: none !important;
}
.book-card:active { transform: scale(0.97); }
.book-card__cover {
  position: relative;
  width: 100%;
  padding-bottom: 150% !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-bg-3);
  box-shadow: var(--s-card);
  transition: var(--t-base);
  display: block;
  flex: 0 0 auto !important;
}
.book-card__cover img {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: var(--t-slow);
}
.book-card__cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.8) 100%);
  opacity: 0; transition: var(--t-base);
}
.book-card:hover .book-card__cover {
  transform: translateY(-6px);
  box-shadow: var(--s-card-hover), var(--s-glow-y);
}
.book-card:hover .book-card__cover img { transform: scale(1.05); }
.book-card:hover .book-card__cover::after { opacity: 1; }

.book-card__badge {
  position: absolute; top: 8px; left: 8px;
  padding: 4px 10px; border-radius: var(--r-full);
  background: var(--g-fire); color: #000;
  font-size: 10px; font-weight: 800;
  box-shadow: var(--s-glow-y);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.book-card__rating {
  position: absolute; top: 8px; right: 8px;
  padding: 4px 8px; border-radius: var(--r-full);
  background: rgba(0,0,0,.75); backdrop-filter: blur(8px);
  color: var(--c-yellow); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; gap: 3px;
}
.book-card__like {
  position: absolute; bottom: 10px; right: 10px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent; border: none;
  opacity: 1; transition: var(--t-base);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.7));
}
.book-card__like svg {
  width: 22px; height: 22px;
  fill: none; stroke: #fff; stroke-width: 2;
  transition: var(--t-base);
}
.book-card__like:hover svg { stroke: var(--c-red); transform: scale(1.15); }
.book-card__like.active svg {
  fill: var(--c-red); stroke: var(--c-red);
  animation: heart-pop .4s var(--t-base);
  filter: drop-shadow(0 0 6px rgba(255,65,51,0.6));
}
.book-card__like:active { transform: scale(0.85); }
@keyframes heart-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* book-card__title: внешний flex-контейнер с фикс. высотой 52px.
   Сам clamp лежит в .book-card__title-inner (так стабильнее в Blink/WebKit). */
.book-card__title {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  color: #1a1a1a;
  background: linear-gradient(135deg, #ffd60a 0%, #ffb800 100%);
  padding: 8px 12px;
  border-radius: var(--r-md);
  min-height: 52px !important;
  max-height: 52px !important;
  height: 52px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  text-align: center;
  letter-spacing: -0.01em;
  transition: var(--t-base);
  box-sizing: border-box;
  flex: 0 0 52px !important;
}
.book-card__title-inner {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  max-height: 36px !important;
  line-height: 1.25 !important;
  width: 100% !important;
  text-align: center !important;
}
.book-card:hover .book-card__title {
  background: linear-gradient(135deg, #ffe14a 0%, #ffc73a 100%);
  transform: translateY(-1px);
}
.book-card__author {
  font-size: 10px;
  color: #fff;
  background: linear-gradient(135deg, #ff4133 0%, #c8160e 100%);
  padding: 0 12px;
  border-radius: var(--r-full);
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.book-card__year {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-3);
  text-align: center;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  margin-top: -4px;
  align-self: center;
}
.book-card__year::before {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--c-text-4);
  margin-right: 8px;
  vertical-align: middle;
  margin-bottom: 2px;
}

/* ============================================
   horizontal scroll (carousel) — mobile-first
   ============================================ */
.carousel {
  position: relative;
}
.carousel__track {
  display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding: var(--gutter);
  -webkit-overflow-scrolling: touch;
  padding: 4px var(--gutter) 16px;
  margin: 0 calc(-1 * var(--gutter));
  scrollbar-width: none;
  scroll-behavior: smooth;
}
@media (min-width: 720px) { .carousel__track { gap: 18px; } }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 138px;
}
@media (min-width: 480px) { .carousel__track > * { width: 152px; } }
@media (min-width: 720px) { .carousel__track > * { width: 172px; } }

.carousel__btn {
  position: absolute; top: 35%; z-index: 5;
  width: 44px; height: 44px; border-radius: var(--r-full);
  background: var(--c-bg-2); border: 1px solid var(--c-border-2);
  color: var(--c-text); display: none;
  align-items: center; justify-content: center;
  box-shadow: var(--s-card);
  transition: var(--t-base);
}
.carousel__btn:hover {
  background: var(--c-yellow); color: #000; border-color: var(--c-yellow);
  box-shadow: var(--s-glow-y);
}
.carousel__btn--prev { left: -8px; }
.carousel__btn--next { right: -8px; }
@media (min-width: 900px) { .carousel__btn { display: flex; } }

/* dots indicator (mobile only) */
.carousel__dots {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 4px;
}
@media (min-width: 900px) { .carousel__dots { display: none; } }
.carousel__dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-text-4); transition: var(--t-base);
}
.carousel__dots span.active {
  width: 20px; border-radius: var(--r-full); background: var(--c-yellow);
  box-shadow: 0 0 8px rgba(255,214,10,.5);
}

/* book grid — mobile-first */
.book-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 480px)  { .book-grid { gap: 18px; grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px)  { .book-grid { gap: 20px; grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 980px)  { .book-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1200px) { .book-grid { grid-template-columns: repeat(6, 1fr); } }

/* sticky CTA для мобилы (на странице книги, например) */
.sticky-cta {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--nav-h-mob) + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  padding: 12px var(--gutter);
  background: linear-gradient(180deg, transparent 0%, var(--c-bg) 30%);
  display: flex; gap: 10px;
}
.sticky-cta .btn { flex: 1; }
@media (min-width: 900px) { .sticky-cta { display: none; } }

/* floating action buttons (mobile, e.g. share/like on book page) */
.fab-stack {
  position: fixed; right: 16px;
  bottom: calc(var(--nav-h-mob) + 80px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: flex; flex-direction: column; gap: 10px;
}
.fab-stack__btn {
  width: 52px; height: 52px; border-radius: var(--r-full);
  background: var(--c-bg-2); color: var(--c-text);
  display: grid; place-items: center;
  box-shadow: var(--s-card);
  border: 1px solid var(--c-border-2);
  transition: var(--t-base);
}
.fab-stack__btn:active { transform: scale(0.9); }
.fab-stack__btn--accent {
  background: var(--g-fire); color: #000;
  box-shadow: var(--s-glow-y);
}
@media (min-width: 900px) { .fab-stack { display: none; } }

/* ============================================
   footer
   ============================================ */
.footer {
  margin-top: 60px;
  padding: 40px 0 24px;
  background: var(--c-bg-2);
  border-top: 1px solid var(--c-border);
}
@media (min-width: 720px) { .footer { margin-top: 80px; padding: 48px 0 32px; } }
.footer__grid {
  display: grid; gap: 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .footer__grid { gap: 32px; grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer h4 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--c-text-3); margin-bottom: 14px; font-weight: 700;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer a {
  color: var(--c-text-2); font-size: 14px; transition: var(--t-fast);
  min-height: 32px; display: inline-flex; align-items: center;
}
.footer a:hover { color: var(--c-yellow); }
.footer__copy {
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--c-border);
  color: var(--c-text-4); font-size: 12px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
}

/* ============================================
   animations
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,214,10,.5); }
  50%      { box-shadow: 0 0 0 14px rgba(255,214,10,0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.fade-in { animation: fadeInUp .6s var(--t-slow) backwards; }
.pulse   { animation: pulse 2s infinite; }

.skeleton {
  background: linear-gradient(90deg, var(--c-bg-2) 0%, var(--c-bg-3) 50%, var(--c-bg-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s, transform .8s var(--t-slow); }
.reveal.show { opacity: 1; transform: translateY(0); }

/* mobile-tap feedback */
.tap { transition: transform var(--t-fast); }
.tap:active { transform: scale(0.95); }

/* ============================================
   pagination (Laravel default — Bootstrap-like markup)
   ============================================ */
.pagination,
ul.pagination {
  display: flex; flex-wrap: wrap; gap: 6px;
  list-style: none; padding: 0; margin: 0;
  justify-content: center; align-items: center;
}
.pagination li { display: flex; }
.pagination li > a,
.pagination li > span {
  min-width: 44px; height: 44px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-weight: 600; font-size: 14px;
  text-decoration: none;
  transition: var(--t-base);
}
.pagination li > a:hover {
  color: var(--c-yellow);
  border-color: var(--c-yellow);
  background: var(--c-bg-3);
}
.pagination li > a:active { transform: scale(0.95); }
.pagination li.active > span,
.pagination li.active > a {
  background: var(--g-fire); color: #000;
  border-color: transparent;
  box-shadow: var(--s-glow-y);
  cursor: default;
}
.pagination li.disabled > span {
  opacity: 0.35; cursor: not-allowed;
}
/* «стр. N [Перейти]» — Laravel paginate input, превращаем в строку */
.pagination li > form {
  display: inline-flex; align-items: center; gap: 6px;
}
.pagination li input[type="number"],
.pagination li input[type="text"] {
  width: 60px; height: 44px;
  background: var(--c-bg-2); border: 1px solid var(--c-border);
  border-radius: var(--r-sm); color: var(--c-text);
  padding: 0 8px; text-align: center; font-size: 14px;
  -moz-appearance: textfield;
}
.pagination li input::-webkit-outer-spin-button,
.pagination li input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ============================================
   popular author card (.pa-card) — фикс. высота для карусели
   ============================================ */
.pa-card {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  text-align: center;
  padding: 16px 10px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  width: 140px;
  height: 160px;
  transition: var(--t-base);
  text-decoration: none;
}
.pa-card:hover {
  border-color: var(--c-yellow);
  transform: translateY(-3px);
  box-shadow: var(--s-glow-y);
}
.pa-card:active { transform: scale(0.96); }
.pa-card__avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--g-fire);
  display: grid; place-items: center;
  font-weight: 800; color: #000; font-size: 22px;
  margin-bottom: 10px;
  box-shadow: var(--s-glow-y);
  flex-shrink: 0;
}
.pa-card__name {
  font-weight: 600; font-size: 13px;
  color: var(--c-text); line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
