/* Тёмная тема каталога. Mobile-first: базовые правила — под телефон,
   медиазапросы только расширяют сетку вверх. */

:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1e242e;
  --border: #2c333d;
  --text: #e6e9ef;
  --muted: #8b95a5;
  --accent: #e8a33d;
  --accent-hi: #f5bb61;
  --radius: 4px;
  --header-h: 56px;
  --gap: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-wrap: break-word;
}

a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

.shell { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Плитка: кадр и подпись под ним. Ширина кадра задаётся сеткой,
   пропорция держится самим изображением. --- */

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  padding-bottom: 6px;
}
@media (min-width: 600px)  { .tiles { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px)  { .tiles { grid-template-columns: repeat(5, 1fr); --gap: 8px; } }
@media (min-width: 1280px) { .tiles { grid-template-columns: repeat(6, 1fr); } }

.tile {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: opacity .12s linear;
}
.tile:hover { transform: translateY(-2px); border-color: #45455a; }
.tile .placeholder { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); }
.tile img, .tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile video { opacity: 0; transition: opacity .12s linear; }
.tile video.on { opacity: 1; }

.tile .t {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 9px 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .82));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile .tag {
  position: absolute;
  top: 7px; left: 7px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tile .tag.gif { background: var(--accent); }

/* --- Типографика страницы: заголовки, вводный текст, хлебные крошки. --- */

.block-head { padding: 22px 0 14px; }
.block-head h1 { margin: 0 0 6px; font-size: 25px; line-height: 1.45; letter-spacing: -0.01em; }
.block-head p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 74ch; }
.trail { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); padding-top: 14px; }
.trail a:hover { color: var(--accent-hi); }

/* --- Оформление раздела. --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 11, 15, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
}

.logo {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo b { color: var(--accent); }

/* Полоса категорий: на телефоне листается пальцем вбок. */
.tabs {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.tabs__inner { position: relative; }
.tabs ul {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 8px 12px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  /* scroll-behavior здесь намеренно нет: прокрутку стрелками анимирует
     app.js, а нативная плавность с ней только конфликтует. */
  /* На телефоне полоса листается пальцем, инерция обязательна. */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.tabs ul::-webkit-scrollbar { display: none; }

/* Стрелки нужны и на десктопе, и на телефоне: без них не видно,
   что справа есть ещё категории. Прячутся, когда листать некуда. */
.tabs__arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.tabs__arrow[hidden] { display: none; }
.tabs__arrow svg { width: 22px; height: 22px; fill: currentColor; }
.tabs__arrow.left {
  left: 0;
  background: linear-gradient(90deg, var(--bg) 55%, rgba(11, 11, 15, 0));
  justify-content: flex-start;
  padding-left: 4px;
}
.tabs__arrow.right {
  right: 0;
  background: linear-gradient(270deg, var(--bg) 55%, rgba(11, 11, 15, 0));
  justify-content: flex-end;
  padding-right: 4px;
}
.tabs__arrow:hover svg { color: var(--accent-hi); }
.tabs a {
  display: block;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  transition: opacity .12s linear;
}
.tabs a:hover { color: var(--text); border-color: #3a3a4a; }
.tabs a[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* --- Оформление раздела. --- */

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 22px 0 8px;
}
.pager a, .pager span {
  min-width: 40px;
  padding: 8px 10px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
  color: var(--muted);
}
.pager a:hover { color: var(--text); border-color: #45455a; }
.pager .is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pager .gap { border: 0; background: none; min-width: 20px; padding: 8px 2px; }
.pager .nav { font-weight: 600; color: var(--text); }

/* --- Оформление раздела. --- */

.entry { padding: 18px 0 6px; }
.stage {
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  justify-content: center;
}
.stage video, .stage img { width: 100%; height: auto; max-height: 78vh; object-fit: contain; }

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 14px 0 4px;
}
.save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border: 0;
  transition: opacity .12s linear;
}
.save:hover { background: var(--accent-hi); }
.save svg { width: 17px; height: 17px; fill: currentColor; }
.save .sz { font-weight: 400; opacity: .8; font-size: 13px; }

.pill {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}
.pill:hover { color: var(--text); border-color: #45455a; }

.block { padding: 26px 0 0; }
.block h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: -0.01em; }

/* --- Оформление раздела. --- */

.footer-strip {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0 34px;
  font-size: 13.5px;
  color: var(--muted);
}
.footer-strip h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: -0.01em; color: var(--text); }
.footer-strip .sections { display: flex; flex-wrap: wrap; gap: 7px 16px; margin-bottom: 20px; }
.footer-strip .sections a:hover { color: var(--accent-hi); }
.footer-strip .legal { border-top: 1px solid var(--border); padding-top: 16px; font-size: 12.5px; line-height: 1.45; }

/* --- Оформление раздела. --- */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 5, 8, .96);
  backdrop-filter: blur(6px);
}
.age-gate[hidden] { display: none; }
.age-gate .panel {
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 24px;
  text-align: center;
}
.age-gate h2 { margin: 0 0 10px; font-size: 21px; }
.age-gate p { margin: 0 0 20px; color: var(--muted); font-size: 14.5px; }
.age-gate .line { display: flex; gap: 10px; justify-content: center; }
.age-gate button, .age-gate a {
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-family: "Inter Tight", "Segoe UI", system-ui, sans-serif;
}
.age-gate button { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { transition: opacity .12s linear; animation: none !important; }
}


/* Плитка каталога: подпись под кадром, а не поверх него — своя подача,
   поэтому кадр держит пропорцию сам, без наложения текста. */
.tile { display: flex; flex-direction: column; gap: 6px; }
.tile figcaption { font-size: 12px; color: var(--muted); padding: 0 2px 4px; }
.tile .placeholder { display: block; overflow: hidden; border-radius: var(--radius); }
.tiles { list-style: none; margin: 0; padding: 0; }
.tiles > li { display: block; }
.topbar { position: sticky; top: 0; z-index: 20; }
/* --- Выбор языка: свёрнутый список, раскрывается по нажатию. --- */

.langs { position: relative; margin-left: auto; }
.langs > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
}
.langs > summary::-webkit-details-marker { display: none; }
.langs > summary::after {
  content: "";
  width: 0; height: 0;
  border: 4px solid transparent;
  border-top-color: var(--muted);
  margin-top: 3px;
}
.langs ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,.45);
  min-width: 168px;
}
.langs li a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--muted);
}
.langs li a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.langs li a[aria-current] { color: var(--text); font-weight: 600; }
.flag-ico { width: 22px; height: 15px; border-radius: 2px; flex: none; box-shadow: 0 1px 0 rgba(0,0,0,.45); }

