/* VELURA - page-anime.css (nsfw-anime only) | anime-* art-board + an-*/anh-* content sections | after components.css */

/* =====================================================================
   АНИМЕ-СТУДИЯ «АРТ-БОРД» (страница nsfw-anime) — движок js/anime.js
   Одноколоночная композиция (в отличие от studio-* на реализме):
   крупный холст сверху → промпт → стили → настройки → теги → генерация.
   ===================================================================== */
.anime-tool {
    position: relative; z-index: 1;
    max-width: 1120px; margin: 0 auto; text-align: left;
    display: flex; flex-direction: column; gap: 20px;
}
.anime-cols {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start;
}
@media (max-width: 900px) {
    .anime-cols { grid-template-columns: 1fr; }
    .anime-panel { position: static; }
}
.anime-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.anime-panel {
    position: sticky; top: 88px;
    border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow);
    background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    padding: 20px; display: flex; flex-direction: column; gap: 18px;
}
.anime-group { display: flex; flex-direction: column; gap: 9px; }
.anime-sliders { gap: 14px; }
.anime-history { grid-column: 1 / -1; }

/* бейдж AI-конвертера в панели промпта */
.anime-badge-ai {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
    padding: 9px 13px; border-radius: var(--radius-sm);
    font-size: 12.5px; color: var(--ink-soft);
    background: rgba(70,209,123,0.08); border: 1px solid rgba(70,209,123,0.28);
}
.anime-badge-ai b {
    margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: #0c1a10; background: #46d17b; padding: 3px 9px; border-radius: 999px;
}

/* панель: сегменты на всю ширину, карточки стиля 2×2 */
.anime-panel .anime-seg { display: flex; flex-wrap: wrap; }
.anime-panel .anime-seg button { flex: 1 1 auto; min-width: 44px; padding: 9px 10px; }
.anime-panel .anime-styles { grid-template-columns: 1fr; }
.anime-panel .anime-slider label { font-weight: 600; }

/* ---------- Холст результата ---------- */
.anime-stage {
    position: relative; border-radius: var(--radius-lg);
    border: 1px solid var(--acc-soft); box-shadow: 0 30px 70px -34px var(--acc-glow);
    min-height: 440px; display: grid; place-items: center; padding: 24px; overflow: hidden;
    background: radial-gradient(130% 100% at 50% 0%, rgba(255,77,109,0.07), rgba(255,255,255,0.02) 55%);
}
/* В состоянии результатов высоту диктует контент, а не min-height — иначе
   горизонтальные кадры (16:9) оставляют большие пустоты сверху/снизу. */
.anime-stage[data-state="results"] { min-height: 0; }
.anime-stage::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; z-index: 2;
    background: var(--acc-grad);
}
.anime-stage__demo { display: none; }
.anime-stage__empty { text-align: center; max-width: 360px; }
.anime-stage__empty-ico {
    width: 66px; height: 66px; margin: 0 auto 16px; display: grid; place-items: center;
    font-size: 30px; border-radius: 18px; color: #fff; background: var(--acc-grad);
    box-shadow: 0 12px 30px -10px var(--acc-glow);
}
.anime-stage__empty-title { font-family: var(--font-head); font-size: 21px; margin-bottom: 8px; }
.anime-stage__empty-sub { color: var(--ink-mute); font-size: 14.5px; }
.anime-stage__loading { text-align: center; }
.anime-spinner {
    width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.10); border-top-color: var(--acc);
    animation: stSpin .9s linear infinite;
}
/* ⚠️ keyframes ДУБЛИРУЕМ здесь: stSpin определён в page-generator.css, но страница аниме
   его НЕ подключает → без этого спиннер не крутился (анимация не находила keyframes). */
@keyframes stSpin { to { transform: rotate(360deg); } }
.anime-stage__load { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 14px; }
.anime-prog { width: 220px; max-width: 60vw; height: 6px; margin: 0 auto; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.anime-prog span { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--acc-grad); transition: width .2s linear; }

/* сетка результатов.
   Раскладка зависит от количества И от ориентации формата (data-orient).
   Горизонтальные кадры (16:9 → landscape) требуют другой сетки, иначе плитки
   выходят крошечными и холст остаётся полупустым. */
.anime-stage__results { width: 100%; display: grid; gap: 12px; justify-content: center; }

/* один результат: ширина подстраивается под ориентацию */
.anime-stage__results[data-count="1"] { grid-template-columns: minmax(0, 360px); }                 /* дефолт = портрет */
.anime-stage__results[data-count="1"][data-orient="square"]    { grid-template-columns: minmax(0, 460px); }
.anime-stage__results[data-count="1"][data-orient="landscape"] { grid-template-columns: minmax(0, min(100%, 900px)); }

/* 4 результата: 2 колонки для любой ориентации */
.anime-stage__results[data-count="4"] { grid-template-columns: repeat(2, 1fr); }

/* 8 результатов: портрет/квадрат — 4 колонки; горизонталь — 2 колонки (крупнее) */
.anime-stage__results[data-count="8"] { grid-template-columns: repeat(4, 1fr); }
.anime-stage__results[data-count="8"][data-orient="landscape"] { grid-template-columns: repeat(2, 1fr); }
.anime-tile {
    position: relative; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--line-soft); background: #1a1620; aspect-ratio: 2 / 3;
    animation: stFade .5s var(--ease) both;
}
.anime-tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.anime-tile__ph { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center; padding: 14px; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); background: #1a1620; }
.anime-tile__badge { position: absolute; top: 8px; left: 8px; z-index: 3; width: 20px; height: 20px; display: grid; place-items: center; font-size: 11px; font-weight: 700; border-radius: 6px; color: var(--on-acc); background: var(--acc-grad); }
.anime-tile__actions { position: absolute; inset: 0; z-index: 3; opacity: 0; display: flex; align-items: flex-end; justify-content: center; gap: 8px; padding: 12px; background: linear-gradient(180deg, transparent 55%, rgba(8,8,11,0.78)); transition: opacity .25s var(--ease); }
.anime-tile:hover .anime-tile__actions { opacity: 1; }
.anime-tile__btn { width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; color: var(--ink); background: rgba(20,16,16,0.7); border: 1px solid var(--line-soft); transition: background .2s, border-color .2s, transform .2s; }
.anime-tile__btn:hover { background: var(--acc); color: var(--on-acc); border-color: transparent; transform: translateY(-2px); }
.anime-error { grid-column: 1/-1; text-align: center; color: var(--acc-soft); font-size: 14px; line-height: 1.6; padding: 32px 18px; }

/* ---------- Панель промпта ---------- */
.anime-promptbar { border-radius: var(--radius); border-color: var(--line); padding: 16px; }
.anime-tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.anime-tabbtn {
    padding: 7px 15px; border-radius: 999px; cursor: pointer;
    font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink-soft);
    background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft);
    transition: color .2s, background .2s, border-color .2s;
}
.anime-tabbtn:hover { color: var(--ink); border-color: var(--line); }
.anime-tabbtn.is-on { background: var(--acc-grad); color: var(--on-acc); border-color: transparent; }
.anime-enhance {
    margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
    font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--acc-soft);
    background: rgba(255,120,80,.10); border: 1px solid rgba(255,120,80,.35); transition: all .18s ease;
}
.anime-enhance:hover { background: rgba(255,120,80,.18); border-color: rgba(255,120,80,.6); color: #fff; }
.anime-enhance:disabled { opacity: .6; cursor: default; }
.anime-enhance:disabled::after { animation: none; opacity: .3; }

/* бегущее свечение по обводке (по часовой) */
@property --ae-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.anime-enhance { position: relative; isolation: isolate; }
.anime-enhance::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
    background: conic-gradient(from var(--ae-angle),
        rgba(255,138,61,0) 0deg,
        rgba(255,138,61,0) 210deg,
        #ff8a3d 290deg,
        #ff4d6d 335deg,
        rgba(255,77,109,0) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    filter: drop-shadow(0 0 5px rgba(255,120,80,.75));
    pointer-events: none;
    animation: aeBeam 2.8s linear infinite;
}
@keyframes aeBeam { to { --ae-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .anime-enhance::after { animation: none; } }
.anime-input {
    width: 100%; min-height: 92px; resize: vertical;
    background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
    padding: 13px 14px; color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.55;
    transition: border-color .2s, box-shadow .2s;
}
.anime-input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(255,77,109,0.12); }
.anime-input.is-error { border-color: var(--acc); animation: stShake .4s; }
.anime-promptbar__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.anime-count { font-size: 12.5px; color: var(--ink-mute); }
.anime-clear { background: none; border: none; cursor: pointer; font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--acc-soft); transition: color .2s; }
.anime-clear:hover { color: var(--acc); text-decoration: underline; }

/* ---------- Быстрый старт ---------- */
.anime-quick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anime-quick__label { font-size: 13px; color: var(--ink-mute); }
.anime-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.anime-preset {
    padding: 8px 14px; border-radius: 999px; cursor: pointer;
    font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--ink-soft);
    background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft);
    transition: color .2s, background .2s, border-color .2s, transform .2s;
}
.anime-preset:hover { color: var(--ink); border-color: var(--acc); transform: translateY(-2px); }
.anime-dice {
    margin-left: auto; padding: 9px 16px; border-radius: 999px; cursor: pointer;
    font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--acc-soft);
    background: rgba(255,77,109,0.08); border: 1px solid var(--line); transition: border-color .2s, background .2s;
}
.anime-dice:hover { border-color: var(--acc); background: rgba(255,77,109,0.14); }

/* Быстрый старт — заголовок-ряд + ряд карусели */
.anime-quick { flex-direction: column; align-items: stretch; gap: 9px; flex-wrap: nowrap; }
.anime-quick__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.anime-quick__label { flex: none; white-space: nowrap; font-weight: 700; color: var(--acc-soft); font-size: 13px; }
.anime-quick .anime-dice { margin-left: 0; }
.anime-carousel { display: flex; align-items: center; gap: 8px; }
.anime-carousel__nav {
    flex: none; width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: rgba(255,255,255,0.05); border: 1px solid var(--line-soft);
    color: var(--ink); font-size: 18px; line-height: 1; padding: 0;
    transition: border-color .2s, background .2s;
}
.anime-carousel__nav:hover { border-color: var(--acc); background: rgba(255,77,109,0.12); }
.anime-presets {
    flex: 1 1 auto; min-width: 0; flex-wrap: nowrap;
    overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth;
    scrollbar-width: none; -ms-overflow-style: none; padding: 6px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
            mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.anime-presets::-webkit-scrollbar { display: none; }
.anime-preset {
    flex: none; scroll-snap-align: start;
    display: inline-flex; align-items: center; gap: 7px;
}
.anime-preset__ico { font-size: 15px; line-height: 1; }
.anime-preset__txt { white-space: nowrap; }

/* ---------- Блоки / метки ---------- */

.anime-block, .anime-settings, .anime-tags { border-radius: var(--radius); border-color: var(--line-soft); padding: 16px; }
.anime-block__label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 10px; }

/* стили подачи — аккуратные строки «иконка + текст» */
.anime-styles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.anime-style {
    display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer;
    padding: 11px 12px; border-radius: 12px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft);
    transition: border-color .2s, background .2s, transform .2s;
}
.anime-style:hover { border-color: var(--line); transform: translateY(-1px); }
.anime-style.is-on { border-color: var(--acc); background: rgba(255,77,109,0.10); box-shadow: 0 8px 22px -14px var(--acc-glow); }
.anime-style__ico {
    flex: none; width: 34px; height: 34px; display: grid; place-items: center;
    font-size: 17px; border-radius: 10px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--line-soft);
    transition: background .2s, border-color .2s;
}
.anime-style.is-on .anime-style__ico { background: var(--acc-grad); border-color: transparent; }
.anime-style__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.anime-style__txt b { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.15; }
.anime-style__txt i { font-size: 11px; font-style: normal; color: var(--ink-mute); line-height: 1.2; }
.anime-style.is-on .anime-style__txt b { color: var(--acc-soft); }

/* настройки: формат/количество/продвинутые */
.anime-settings { display: flex; flex-wrap: wrap; gap: 16px 22px; align-items: flex-start; }
.anime-set { display: flex; flex-direction: column; gap: 8px; }
.anime-seg { display: inline-flex; gap: 6px; padding: 5px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); }
.anime-seg button {
    padding: 8px 14px; border: none; background: transparent; cursor: pointer; border-radius: 8px;
    font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--ink-soft); transition: color .2s, background .2s;
}
.anime-seg button:hover { color: var(--ink); }
.anime-seg button.is-on { background: var(--acc-grad); color: var(--on-acc); }
.anime-seg--q button { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.1; }
.anime-seg--q button b { font-size: 13px; font-weight: 700; }
.anime-seg--q button i { font-size: 10px; font-style: normal; opacity: 0.6; }
.anime-seg--q button.is-on i { opacity: 0.9; }
.anime-adv { flex: 1 1 100%; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.anime-adv > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 9px; transition: color .2s; }
.anime-adv > summary:hover { color: var(--acc-soft); }
.anime-adv > summary::-webkit-details-marker { display: none; }
.anime-adv > summary::before {
    content: ""; flex: none; width: 0; height: 0;
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-top: 7px solid var(--acc);
    transition: transform .2s var(--ease);
}
.anime-adv[open] > summary::before { transform: rotate(180deg); }
.anime-adv__body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; margin-top: 14px; align-items: end; }
.anime-slider { display: flex; flex-direction: column; gap: 8px; }
.anime-slider label { font-size: 13px; color: var(--ink-soft); display: flex; justify-content: space-between; }
.anime-slider label b { color: var(--acc-soft); }
.anime-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--acc), var(--acc-2)); outline: none; cursor: pointer; }
.anime-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--acc); box-shadow: 0 0 10px var(--acc-glow); cursor: pointer; }
.anime-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--acc); cursor: pointer; }
.anime-seed { display: flex; flex-direction: column; gap: 8px; }
.anime-seed > label { font-size: 13px; color: var(--ink-soft); }
.anime-seed__row { display: flex; gap: 6px; }
.anime-seed__row input { flex: 1; min-width: 0; padding: 9px 12px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); color: var(--ink); font-family: var(--font-mono); font-size: 13px; }
.anime-seed__row input:focus { outline: none; border-color: var(--acc); }
.anime-seed__row button { width: 40px; flex-shrink: 0; border-radius: var(--radius-sm); cursor: pointer; background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); color: var(--ink); font-size: 14px; transition: border-color .2s, background .2s; }
.anime-seed__row button:hover { border-color: var(--acc); }
.anime-seed__row button[data-locked="true"] { background: rgba(255,77,109,0.12); border-color: var(--acc); }
.anime-adv__hint { grid-column: 1/-1; font-size: 12.5px; color: var(--acc-soft); background: rgba(255,77,109,0.08); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 12px; }
.anime-adv__body .anime-seed { grid-column: 1 / -1; }

/* ---------- Лайтбокс просмотра изображения ---------- */
.anime-lightbox { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 24px; }
.anime-lightbox__backdrop { position: absolute; inset: 0; background: rgba(6,6,8,0.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.anime-lightbox__stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 96vw; max-height: 92vh; }
.anime-lightbox__img { max-width: 96vw; max-height: 78vh; width: auto; height: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); object-fit: contain; background: #1a1620; }
.anime-lightbox__close {
    position: absolute; top: -14px; right: -14px; width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; background: rgba(17,17,22,0.95); border: 1px solid var(--line); color: var(--ink);
    font-size: 24px; line-height: 1; display: grid; place-items: center; transition: border-color .2s, background .2s;
}
.anime-lightbox__close:hover { border-color: var(--acc); background: rgba(255,77,109,0.18); }
.anime-lightbox__nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%;
    cursor: pointer; background: rgba(17,17,22,0.7); border: 1px solid var(--line-soft); color: var(--ink);
    font-size: 26px; line-height: 1; display: grid; place-items: center; transition: border-color .2s, background .2s;
}
.anime-lightbox__nav:hover { border-color: var(--acc); background: rgba(255,77,109,0.18); }
.anime-lightbox__nav--prev { left: -62px; }
.anime-lightbox__nav--next { right: -62px; }
.anime-lightbox__bar { display: flex; gap: 10px; }
.anime-lightbox__btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
    font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink);
    background: rgba(255,255,255,0.06); border: 1px solid var(--line-soft);
    transition: background .2s, border-color .2s, transform .2s;
}
.anime-lightbox__btn:hover { background: var(--acc); color: var(--on-acc); border-color: transparent; transform: translateY(-2px); }
@media (max-width: 640px) {
    /* На телефоне сцена/картинка ограничиваются шириной экрана с учётом паддинга,
       иначе широкие кадры (16:9, 1:1) раздувают сцену на 96vw и выносят кнопки за край. */
    .anime-lightbox { padding: 12px; }
    .anime-lightbox__stage { max-width: 100%; }
    .anime-lightbox__img { max-width: 100%; max-height: 72vh; }
    /* Крестик — внутрь верхнего-правого угла (а не наружу сцены), чтобы не срезался краем. */
    .anime-lightbox__close { top: 8px; right: 8px; }
    /* Стрелки — наложены на края картинки внутри экрана. */
    .anime-lightbox__nav { width: 40px; height: 40px; font-size: 22px; }
    .anime-lightbox__nav--prev { left: 4px; }
    .anime-lightbox__nav--next { right: 4px; }
    .anime-lightbox__btn span { display: none; }
}

/* ---------- Конструктор тегов ---------- */
.anime-search { width: 100%; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); color: var(--ink); font-family: var(--font-body); font-size: 14px; margin-bottom: 12px; transition: border-color .2s; }
.anime-search:focus { outline: none; border-color: var(--acc); }
.anime-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); transition: opacity .15s; }
.anime-cats.is-dim { opacity: .35; pointer-events: none; }
.anime-catbtn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; cursor: pointer;
    font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
    background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft); transition: color .15s, background .15s, border-color .15s;
}
.anime-catbtn:hover { color: var(--ink); border-color: var(--line); }
.anime-catbtn.is-on { background: var(--acc-grad); color: var(--on-acc); border-color: transparent; }
.anime-catbtn__ico { font-size: 14px; line-height: 1; }
.anime-catbtn__badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: var(--acc); color: var(--on-acc); }
.anime-catbtn.is-on .anime-catbtn__badge { background: rgba(0,0,0,0.28); }
.anime-cloud { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto; padding-right: 2px; }
.anime-chip {
    padding: 6px 11px; border-radius: 999px; cursor: pointer;
    font-family: var(--font-body); font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
    background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); transition: color .15s, background .15s, border-color .15s;
}
.anime-chip::before { content: "+ "; color: var(--acc-soft); font-weight: 700; }
.anime-chip:hover { color: var(--ink); border-color: var(--line); }
.anime-chip.is-on { background: var(--acc-grad); color: var(--on-acc); border-color: transparent; }
.anime-chip.is-on::before { content: "✓ "; color: var(--on-acc); }
.anime-tags__empty { padding: 10px 4px; font-size: 13px; color: var(--ink-mute); }
.anime-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }
.anime-seltag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 6px 5px 11px; border-radius: 999px; cursor: pointer; font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--on-acc); background: var(--acc-grad); border: 1px solid transparent; transition: filter .15s; }
.anime-seltag:hover { filter: brightness(1.08); }
.anime-seltag__x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 999px; font-size: 14px; line-height: 1; background: rgba(0,0,0,0.22); }

/* ---------- Генерация + история ---------- */
.anime-go { font-size: 16px; }
.anime-cost { text-align: center; font-size: 12.5px; color: var(--ink-mute); }

/* блок «Тарифы и цены» под кнопкой генерации — прямой путь к оплате.
   Отделён тонкой линией; кнопка компактнее «Сгенерировать» (меньше шрифт/паддинг),
   но с той же золотой схемой (--gold-grad), что и на страницах-инструментах. */
.anime-pay { margin-top: 0; }
.anime-pricing {
    display: block; width: 100%;
    background: var(--gold-grad); color: var(--on-gold);
    box-shadow: 0 8px 20px var(--gold-glow);
    font-size: 14px; padding: 11px 18px;
}
.anime-pricing:hover { transform: translateY(-1px); box-shadow: 0 12px 28px var(--gold-glow); }
.anime-history__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.anime-history__head .anime-block__label { margin-bottom: 0; }
.anime-history__list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.anime-hist { position: relative; flex-shrink: 0; width: 72px; height: 108px; border-radius: 12px; overflow: hidden; cursor: pointer; border: 1px solid var(--line-soft); transition: border-color .2s, transform .2s; }
.anime-hist:hover { border-color: var(--acc); transform: translateY(-2px); }
.anime-hist::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 58%, rgba(8,8,11,0.55)); }
.anime-hist__badge { position: absolute; z-index: 2; bottom: 5px; right: 5px; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; color: var(--on-acc); background: var(--acc-grad); }

/* ---------- Адаптив ---------- */
@media (max-width: 640px) {
    .anime-styles { grid-template-columns: repeat(2, 1fr); }
    .anime-adv__body { grid-template-columns: 1fr; }
    /* одиночный результат — во всю ширину экрана независимо от формата */
    .anime-stage__results[data-count="1"] { grid-template-columns: minmax(0, 100%); }
    .anime-stage__results[data-count="4"], .anime-stage__results[data-count="8"] { grid-template-columns: repeat(2, 1fr); }
    /* горизонтальные кадры при 4/8 — крупнее (1 и 2 колонки) */
    .anime-stage__results[data-count="4"][data-orient="landscape"] { grid-template-columns: 1fr; }
    .anime-stage__results[data-count="8"][data-orient="landscape"] { grid-template-columns: repeat(2, 1fr); }
    .anime-stage { min-height: 340px; padding: 16px; }
    .anime-dice, .anime-enhance { margin-left: 0; }
}

/* =====================================================================
   ANIME PAGE — контент-секции (#how #why #guide #about #faq)
   Префикс .an-* / .anh-* — визуально отличается от .gen-* генератора
   ===================================================================== */

/* ---------- #how — bento: процесс + стили + возможности ---------- */
.anh {
    display: grid; grid-template-columns: 1.35fr 1fr; grid-auto-rows: auto;
    gap: 16px;
}
.anh__flow { grid-column: 1; grid-row: 1 / span 2; padding: 30px 30px 26px; border-color: var(--line-soft); }
.anh__badge {
    display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .02em;
    color: var(--acc-soft); background: rgba(255,77,109,0.08); border: 1px solid var(--line);
    padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.anh__flow-title { font-family: var(--font-head); font-size: clamp(21px, 2.4vw, 26px); font-weight: 700; color: var(--ink); margin-bottom: 22px; }
.anh__steps { list-style: none; display: flex; flex-direction: column; gap: 20px; position: relative; }
.anh__steps::before {
    content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px;
    background: linear-gradient(180deg, var(--acc), var(--acc-2)); opacity: .3; border-radius: 2px;
}
.anh__steps li { display: flex; gap: 16px; align-items: flex-start; position: relative; }
.anh__num {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    font-family: var(--font-head); font-size: 17px; font-weight: 700;
    background: var(--acc-grad); color: var(--on-acc); box-shadow: var(--shadow-acc); position: relative; z-index: 1;
}
.anh__step-txt { display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.anh__step-txt b { font-family: var(--font-head); font-size: 17.5px; font-weight: 700; color: var(--ink); }
.anh__step-txt i { font-style: normal; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }

.anh__styles { grid-column: 2; grid-row: 1 / span 2; padding: 26px 24px; border-color: var(--line); }
.anh__styles-title { font-family: var(--font-head); font-size: 21px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.anh__styles-sub { font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); margin-bottom: 18px; }
.anh__stylist { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.anh__stylist li {
    display: flex; align-items: center; gap: 12px; padding: 11px 13px;
    border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--line-soft);
    transition: border-color .25s, background .25s, transform .25s;
}
.anh__stylist li:hover { border-color: var(--line); background: var(--glass-2); transform: translateX(3px); }
.anh__stylist li.is-hot { border-color: var(--line); background: rgba(255,77,109,0.06); }
.anh__st-ico { font-size: 22px; line-height: 1; flex-shrink: 0; }
.anh__stylist li div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.anh__stylist li b { font-family: var(--font-head); font-size: 15.5px; font-weight: 700; color: var(--ink); }
.anh__stylist li i { font-style: normal; font-size: 12.5px; color: var(--ink-soft); }
.anh__stylist li em {
    font-style: normal; font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    color: var(--acc-soft); flex-shrink: 0; white-space: nowrap;
}

.anh__feat {
    display: flex; gap: 15px; align-items: flex-start;
    padding: 20px 22px; border-color: var(--line-soft); transition: border-color .25s, transform .25s, background .25s;
}
.anh__feat:hover { border-color: var(--line); transform: translateY(-4px); background: var(--glass-2); }
.anh__feat:nth-of-type(3) { grid-column: 1; grid-row: 3; }
.anh__feat:nth-of-type(4) { grid-column: 2; grid-row: 3; }
.anh__feat:nth-of-type(5) { grid-column: 1 / -1; grid-row: 4; }
.anh__feat-ico {
    flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
    font-size: 24px; background: rgba(255,77,109,0.10); border: 1px solid var(--line);
}
.anh__feat-txt { display: flex; flex-direction: column; gap: 4px; }
.anh__feat-txt b { font-family: var(--font-head); font-size: 16.5px; font-weight: 700; color: var(--ink); }

/* ---------- #why — метрики + сравнительная таблица ---------- */
.an-stats {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
    max-width: 980px; margin: 0 auto 34px;
}
.an-stat { text-align: center; padding: 18px 10px; border-radius: var(--radius); border-color: var(--line-soft); }
.an-stat b {
    display: block; font-family: var(--font-head); font-size: 32px; font-weight: 700; line-height: 1;
    background: linear-gradient(100deg, var(--acc-2), var(--acc));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.an-stat b span { font-size: 15px; margin-left: 2px; }
.an-stat i { display: block; margin-top: 8px; font-style: normal; font-size: 12.5px; color: var(--ink-mute); }

.an-cmp { max-width: 980px; margin: 0 auto; padding: 10px 14px; border-color: var(--line); overflow: hidden; }
.an-cmp__row {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; align-items: center;
    padding: 15px 12px; border-bottom: 1px solid var(--line-soft);
}
.an-cmp__row:last-child { border-bottom: none; }
.an-cmp__row--head { border-bottom: 1px solid var(--line); }
.an-cmp__row--head span { font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--ink); }
.an-cmp__row--head .an-cmp__velura { color: var(--acc-soft); }
.an-cmp__crit { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.an-cmp__velura, .an-cmp__other { font-size: 13.5px; line-height: 1.4; color: var(--ink-soft); }
.an-cmp__velura b, .an-cmp__other b { display: block; font-size: 14px; margin-bottom: 1px; }
.an-cmp__velura b.ok { color: var(--acc-soft); }
.an-cmp__other b.no { color: var(--ink-mute); }
.an-cmp__row:not(.an-cmp__row--head) .an-cmp__velura {
    padding: 8px 12px; border-radius: var(--radius-sm);
    background: rgba(255,77,109,0.06); border: 1px solid var(--line);
}
.an-cmp__row:not(.an-cmp__row--head) .an-cmp__other { padding: 8px 12px; opacity: .82; }

/* ---------- #guide — промпт-гайд: формула + пример + негатив/параметры ---------- */
.an-guide__h { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.an-formula { max-width: 1000px; margin: 0 auto 18px; padding: 26px 28px; border-color: var(--line); }
.an-formula__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.an-chip {
    font-size: 13.5px; font-weight: 600; color: var(--ink); padding: 8px 14px; border-radius: 999px;
    background: var(--glass-2); border: 1px solid var(--line-soft);
}
.an-chip--style { color: var(--on-acc); background: var(--acc-grad); border-color: transparent; }
.an-plus { font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--acc-soft); }
.an-formula__note { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }

.an-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; max-width: 1000px; margin: 0 auto 18px; }
.an-vs__col { padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--line-soft); background: var(--glass); }
.an-vs__col--weak { border-color: var(--line-soft); }
.an-vs__col--strong { border-color: var(--line); background: rgba(255,77,109,0.05); }
.an-vs__tag { display: inline-block; font-size: 12.5px; font-weight: 700; margin-bottom: 12px; }
.an-vs__col--weak .an-vs__tag { color: var(--ink-mute); }
.an-vs__col--strong .an-vs__tag { color: var(--acc-soft); }
.an-vs__code {
    font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; color: var(--ink);
    padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(0,0,0,0.25);
    border: 1px solid var(--line-soft); margin-bottom: 12px;
}
.an-vs__list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.an-vs__list li { position: relative; padding-left: 20px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.an-vs__col--weak .an-vs__list li::before { content: "–"; position: absolute; left: 4px; color: var(--ink-mute); font-weight: 700; }
.an-vs__col--strong .an-vs__list li::before { content: "✓"; position: absolute; left: 2px; color: var(--acc-soft); font-weight: 700; }
.an-vs__arrow { display: grid; place-items: center; font-size: 26px; color: var(--acc-soft); }

.an-guide__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1000px; margin: 0 auto; align-items: start; }
.an-neg, .an-params { padding: 26px 28px; border-color: var(--line-soft); }
.an-neg__sub { font-size: 14px; line-height: 1.6; color: var(--ink-soft); margin-bottom: 14px; }
.an-neg__code {
    font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: var(--acc-soft);
    white-space: pre-wrap; word-break: break-word; padding: 14px 16px; border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.28); border: 1px solid var(--line-soft); margin-bottom: 12px;
}
.an-neg__hint, .an-params__tip { font-size: 13px; line-height: 1.55; color: var(--ink-mute); }
.an-params__list { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.an-params__list li { display: flex; flex-direction: column; gap: 3px; padding-left: 14px; border-left: 3px solid var(--line); }
.an-params__list li b { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--acc-soft); }
.an-params__list li span { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }

.anh__feat-txt i { font-style: normal; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }

/* ---------- #about — лонгрид + факты ---------- */
.an-seo { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; max-width: 1080px; margin: 0 auto; }
.an-seo__main {
    padding: 44px 46px; border-radius: var(--radius-lg);
    background: var(--glass); border: 1px solid var(--line-soft); backdrop-filter: blur(18px);
}
.an-seo__title { font-family: var(--font-head); font-size: clamp(26px, 3.4vw, 36px); font-weight: 700; line-height: 1.18; letter-spacing: -.4px; margin: 10px 0 22px; }
.an-seo__main p { color: var(--ink-soft); font-size: 16.5px; line-height: 1.8; margin-bottom: 16px; }
.an-seo__lead { font-size: 18px !important; color: var(--ink) !important; }
.an-seo__main h3 {
    position: relative; font-family: var(--font-head); font-size: 22px; font-weight: 700; line-height: 1.25;
    color: var(--ink); margin: 30px 0 12px; padding-left: 16px;
}
.an-seo__main h3::before {
    content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 3px; background: var(--acc-grad);
}
.an-seo__cta-wrap { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.an-seo__facts { position: sticky; top: 96px; }
.an-seo__facts-card { padding: 26px 24px; border-radius: var(--radius); border-color: var(--line); }
.an-seo__facts-title { font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.an-seo__facts-list { display: flex; flex-direction: column; }
.an-seo__facts-list li {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13.5px;
}
.an-seo__facts-list li span { color: var(--ink-mute); flex-shrink: 0; }
.an-seo__facts-list li b { color: var(--ink); font-weight: 600; text-align: right; }
.an-seo__facts-note { margin-top: 16px; font-size: 12.5px; line-height: 1.5; color: var(--ink-mute); }

/* ---------- #faq — одна колонка по центру ---------- */
.an-faq { display: flex; flex-direction: column; gap: 12px; max-width: 780px; margin: 0 auto; }
.an-faq__item {
    border-radius: var(--radius-sm); border-color: var(--line-soft);
    padding: 2px 4px; overflow: hidden; transition: border-color .25s, background .25s;
}
.an-faq__item[open] { border-color: var(--line); background: rgba(255,77,109,0.04); }
.an-faq__q {
    list-style: none; cursor: pointer; padding: 16px 18px; font-size: 15.5px; font-weight: 600; color: var(--ink);
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.an-faq__q::-webkit-details-marker { display: none; }
.an-faq__q::after { content: "+"; font-size: 20px; font-weight: 400; color: var(--acc); transition: transform .25s; flex-shrink: 0; }
.an-faq__item[open] .an-faq__q::after { transform: rotate(45deg); }
.an-faq__a { padding: 0 18px 18px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.65; }

/* ---------- Адаптив контент-секций ---------- */
@media (max-width: 980px) {
    .anh { grid-template-columns: 1fr; }
    .anh__flow, .anh__styles { grid-column: 1; grid-row: auto; }
    .anh__feat:nth-of-type(3), .anh__feat:nth-of-type(4), .anh__feat:nth-of-type(5) { grid-column: 1; grid-row: auto; }
    .an-guide__grid { grid-template-columns: 1fr; }
    .an-seo { grid-template-columns: 1fr; }
    .an-seo__facts { position: static; }
}
@media (max-width: 720px) {
    .an-stats { grid-template-columns: repeat(3, 1fr); }
    .an-seo__main { padding: 30px 24px; }
    .an-vs { grid-template-columns: 1fr; }
    .an-vs__arrow { transform: rotate(90deg); }
    .an-cmp__row { grid-template-columns: 1fr; gap: 8px; }
    .an-cmp__row--head { display: none; }
    .an-cmp__crit { font-size: 15px; margin-bottom: 2px; }
    .an-cmp__row:not(.an-cmp__row--head) .an-cmp__velura::before { content: "🌸 Lovice: "; font-weight: 700; color: var(--acc-soft); }
    .an-cmp__row:not(.an-cmp__row--head) .an-cmp__other::before { content: "⚪ Обычные: "; font-weight: 700; color: var(--ink-mute); }
    /* На мобильных жирное слово идёт в одну строку с хвостом фразы, а не отдельным блоком */
    .an-cmp__velura b, .an-cmp__other b { display: inline; font-size: 13.5px; margin-bottom: 0; }
}
@media (max-width: 560px) {
    .an-stats { grid-template-columns: repeat(2, 1fr); }
    .an-formula__row { gap: 6px; }
    /* Поле промпта/негатива выше на телефонах: 92px → 138px (+50%), чтобы удобнее
       вводить длинный текст и не терять его при быстром скролле по инструменту. */
    .anime-input { min-height: 138px; }
    .anh__stylist li em { display: none; }
}

/* ---------- Адаптив промпт-бара на узких экранах ---------- */
/* Держим «Промпт / Негатив / ✨ Улучшить промпт» в одну строку без горизонтального скролла.
   Комплексно ужимаем все три кнопки; на 320px сокращаем подпись до «✨ Улучшить». */
@media (max-width: 420px) {
    .anime-tabs { gap: 6px; }
    .anime-tabbtn { padding: 6px 11px; font-size: 12.5px; }
    .anime-enhance { padding: 6px 11px; font-size: 12px; gap: 4px; }
}
@media (max-width: 360px) {
    .anime-tabs { gap: 5px; }
    .anime-tabbtn { padding: 6px 9px; font-size: 12px; }
    /* «промпт» дублирует вкладку слева — на самых узких экранах убираем его, чтобы кнопка влезла в 320px */
    .anime-enhance { padding: 6px 9px; gap: 0; font-size: 0; }
    .anime-enhance::before { content: "✨ Улучшить"; font-size: 11.5px; font-weight: 600; }
}
