/* Kinowa — визуальный слой «флагман». Подключается после site.css, smart.css, wide.css, rate.css, series.css.
   Принцип: спокойная тёмная гамма, один акцент (оранжевый) только на главных действиях, без градиентных кнопок и свечений.
   Откат: убрать подключение flagship.css в layout.php. */

:root {
  --ph: #e9ebef;               /* заглушка картинки, светлая тема */
  --ph-hi: #f3f4f7;
  --ink-chip: rgba(12, 14, 19, .78);
  --ok: #3fb950; --so: #d9a21b; --no: #e5534b;
  --ring: rgba(0, 0, 0, .08);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
[data-theme=dark] {
  --ph: #1d212b;
  --ph-hi: #252a36;
  --ring: rgba(255, 255, 255, .07);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(240, 106, 31, .35); }

/* ---------- заглушки картинок: нейтральные, без «радуги» ---------- */
.ph-0, .ph-1, .ph-2, .ph-3, .ph-4, .ph-5, .ph-6, .ph-7 { background: var(--ph); }
.ph-letter { color: var(--muted); opacity: .55; font-weight: 600; font-size: 2.2rem; }
.poster.big .ph-letter { font-size: 4rem; }
/* пока постер грузится — мягкое мерцание; если картинки нет совсем — статично */
/* мерцание только там, где картинка действительно грузится, и не бесконечно (≈10 с), чтобы не тратить ресурсы на ленивые постеры ниже экрана */
.poster:has(> img):not(.ld):not(.img-broken),
.pphoto:has(> img):not(.ld):not(.img-broken) {
  background: linear-gradient(100deg, var(--ph) 30%, var(--ph-hi) 50%, var(--ph) 70%) 0 0 / 300% 100%;
  animation: kw-shimmer 1.6s linear 6;
}
.coll-ph { background: var(--ph); }
.poster img, .pphoto img { position: relative; z-index: 0; }
.poster.ld, .pphoto.ld { animation: none; background: var(--ph); }   /* картинка загрузилась — мерцание выключаем (flagship.js) */
@keyframes kw-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .poster, .pphoto, .coll-ph { animation: none !important; } }
/* битая ссылка на картинку — тихая заглушка с иконкой плёнки */
.img-broken {
  animation: none !important;
  background: var(--ph) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a90a0' stroke-width='1.4' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M7 5v14M17 5v14M3 9.5h4M3 14.5h4M17 9.5h4M17 14.5h4'/%3E%3C/svg%3E") center / 34% no-repeat !important;
}
/* персона без фото — силуэт вместо цветной плитки с буквой */
.pphoto:has(.ph-letter), span.av {
  background: var(--ph) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237d8394'%3E%3Ccircle cx='12' cy='8.2' r='4.2'/%3E%3Cpath d='M3.8 21.5c.6-4.6 4-7.3 8.2-7.3s7.6 2.7 8.2 7.3z'/%3E%3C/svg%3E") center 62% / 58% no-repeat !important;
}
.pphoto .ph-letter, span.av { font-size: 0 !important; color: transparent !important; }
.pphoto:has(.ph-letter) { box-shadow: none; }

/* ---------- шапка: стекло, тонкая граница, тень после прокрутки ---------- */
.top {
  background: rgba(14, 15, 20, .78);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  box-shadow: none;
  transition: box-shadow .25s var(--ease), background-color .25s var(--ease);
}
.top.is-scrolled { background: rgba(14, 15, 20, .9); box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.top .nav > a, .top .dd-btn { color: #c9cdd6; font-weight: 600; transition: color .15s; }
.top .nav > a:hover, .top .dd-btn:hover { color: #fff; text-decoration: none; }
.top .search input { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .06); }
.top .search input:focus { background: rgba(255, 255, 255, .1); border-color: rgba(240, 106, 31, .7); box-shadow: 0 0 0 3px rgba(240, 106, 31, .15); }
.my-count { display: inline-block; min-width: 1.5em; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.5; text-align: center; }

/* ---------- кнопки: сплошной цвет без свечения ---------- */
.btn-main, .t-btn { background: #f06a1f; box-shadow: none; transition: background-color .15s, transform .15s var(--ease); }
.btn-main:hover, .t-btn:hover { background: #ff7a2e; filter: none; }
.btn-main:active, .t-btn:active { transform: translateY(1px); }
.btn-soft { box-shadow: none; transition: border-color .15s, color .15s, background-color .15s; }
.btn-soft.on { border-color: rgba(63, 185, 80, .55); color: var(--ok); background: rgba(63, 185, 80, .08); }
.btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); }

/* ---------- заголовки и ритм ---------- */
.kp-h { font-size: 1.4rem; font-weight: 750; letter-spacing: -.015em; }
.kp-h a { color: inherit; }
.kp-h a:hover { color: var(--accent); text-decoration: none; }
.kp-h .chev { color: var(--muted); transition: transform .2s var(--ease), color .2s; display: inline-block; }
.kp-h a:hover .chev { transform: translateX(3px); color: var(--accent); }
.kp-title { letter-spacing: -.022em; font-weight: 800; }
.rail-block { margin-top: 40px; }

/* ---------- карточки ---------- */
.card .poster { box-shadow: 0 0 0 1px var(--ring), 0 6px 18px rgba(0, 0, 0, .22); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.card:hover .poster { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 16px 34px rgba(0, 0, 0, .42); }
.card .poster img { transition: transform .5s var(--ease); }
.card:hover .poster img { transform: scale(1.03); }
.card-title { margin-top: 10px; font-size: .98rem; font-weight: 650; letter-spacing: -.005em; }
.card:hover .card-title { color: var(--accent); }
.card-meta { margin-top: 2px; font-size: .82rem; }
/* рейтинг на постере: тёмная плашка, цвет — у цифры */
.poster .badge, .banner-meta .badge {
  background: var(--ink-chip); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: 6px; padding: 2px 7px; min-width: 0; font-size: .82rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.poster .badge.good, .banner-meta .badge.good { color: #5fd56f; }
.poster .badge.mid, .banner-meta .badge.mid { color: #f2c14e; }
.poster .badge.bad, .banner-meta .badge.bad { color: #ff7b72; }
.poster .tag { background: var(--ink-chip); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 6px; font-weight: 600; letter-spacing: .02em; }

/* ---------- главная: слайдер с размытым постером на фоне ---------- */
.slide { background: #0d0f14; }
.slide-bg { position: absolute; inset: -40px; z-index: -2; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(48px) saturate(1.15); opacity: .55; transform: translateZ(0); }
.slide:before { background: linear-gradient(90deg, rgba(10, 11, 15, .94) 0%, rgba(10, 11, 15, .7) 50%, rgba(10, 11, 15, .25) 100%); }
.banner-poster { transform: none; border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1); }
.banner-tag { background: rgba(255, 255, 255, .12); font-size: .72rem; letter-spacing: .08em; }
.banner-title { font-weight: 800; letter-spacing: -.025em; }
.sl-dots button.on { background: #fff; }
.sl-arrow { background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .12); }
.sl-arrow:hover { background: rgba(0, 0, 0, .6); }
@media (width<=700px) {
  .banner-descr { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .98rem; }
  .slide-bg { filter: blur(28px) saturate(1.2); opacity: .5; }
  .slide:before { background: linear-gradient(180deg, rgba(10, 11, 15, .55) 0%, rgba(10, 11, 15, .88) 100%); }
}

/* умный поиск: без оранжево-фиолетового свечения, спокойная карточка */
.smart { background: radial-gradient(90% 120% at 50% -20%, rgba(240, 106, 31, .09), transparent 60%), var(--card); border: 0; box-shadow: 0 0 0 1px var(--ring); }
.smart-title { font-weight: 800; letter-spacing: -.025em; }
.smart-go { background: #f06a1f; box-shadow: none; }
.smart-go:hover { background: #ff7a2e; filter: none; transform: none; }
.smart-input:focus { border-color: rgba(240, 106, 31, .7); box-shadow: 0 0 0 3px rgba(240, 106, 31, .15); }
.smart-hint { transition: border-color .15s, color .15s; }
.smart-more > summary { font-size: .92rem; }
/* телефон: блок подбора компактнее — фильмы видны уже на первом экране */
@media (width<=700px) {
  .smart { padding: 18px 14px 14px; }
  .smart-title { font-size: 1.25rem; }
  .smart-sub { display: none; }
  .smart-form { margin-top: 12px; }
  .smart-input, .smart-go, .smart-surprise { height: 48px; }
  .smart-surprise { width: 48px; }
  .smart-hints { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 12px -14px 0; padding: 0 14px 2px; scrollbar-width: none; }
  .smart-hints::-webkit-scrollbar { display: none; }
  .smart-hint { flex: none; }
}

/* лента «Новые серии» */
.ep-card .ep-when { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 5px 8px; border-radius: 7px; background: var(--ink-chip); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; font-size: .78rem; font-weight: 700; text-align: center; }
.ep-card .ep-when:not(.is-past) { box-shadow: inset 0 0 0 1px rgba(240, 106, 31, .55); }
.ep-card .ep-when.is-past { color: #c8ccd5; font-weight: 600; }

/* подборки */
.coll-card { background: var(--card); box-shadow: 0 0 0 1px var(--ring); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.coll-card:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 16px 34px rgba(0, 0, 0, .3); }
.coll-name { font-weight: 700; }

/* ---------- страница фильма: фон из кадра ---------- */
.hero.has-bg { position: relative; isolation: isolate; }
.hero-bg { position: absolute; z-index: -1; top: 0; left: -48px; right: -48px; height: min(640px, 100%); overflow: hidden; border-radius: var(--r) var(--r) 0 0; pointer-events: none; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; opacity: .42; }
.hero-bg.is-poster img { filter: blur(56px) saturate(1.2); transform: scale(1.25); opacity: .5; }
.hero-bg:after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 72%, transparent) 38%, color-mix(in srgb, var(--bg) 35%, transparent) 70%, color-mix(in srgb, var(--bg) 55%, transparent) 100%),
              linear-gradient(180deg, color-mix(in srgb, var(--bg) 20%, transparent) 0%, transparent 30%, color-mix(in srgb, var(--bg) 70%, transparent) 72%, var(--bg) 100%); }
[data-theme=light] .hero-bg img { opacity: .22; }
.hero.has-bg .kp-left .poster { box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .1); }
.hero.has-bg .rating-summary, .hero.has-bg .rate .rate-stars .rs-row { background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.film-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; font-weight: 700; }
.film-jumps a { background: color-mix(in srgb, var(--bg) 75%, transparent); }
.film-jumps .actions { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.film-jumps .actions > form, .film-jumps .actions > .btn-soft:not(.btn-share) { flex: 1 1 auto; min-width: 0; width: auto !important; }
.film-jumps .actions > form > .btn-soft { width: 100%; }
.film-jumps .actions .btn-share { display: inline-flex; align-items: center; justify-content: center; width: auto !important; flex: none; padding: 0 14px; }
@media (width>700px) { .film-jumps .actions > form, .film-jumps .actions > .btn-soft:not(.btn-share) { flex: none; } }
@media (width<=700px) { .hero-bg { left: -16px; right: -16px; height: 520px; } .hero-bg img { opacity: .3; } .hero-bg:after { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 35%, transparent) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 45%, var(--bg) 100%); } }
.rating-summary { box-shadow: 0 0 0 1px var(--ring); border: 0; }
.watch { box-shadow: 0 0 0 1px var(--ring); }
.btn-watch { background: #f06a1f; transition: background-color .15s; }
.btn-watch:hover { background: #ff7a2e; filter: none; }
.series-status .ss-u { background: var(--ph-hi); color: var(--fg); box-shadow: inset 0 0 0 1px var(--ring); }
.series-status .ss-u b { color: var(--fg); }
.series-status { background: linear-gradient(135deg, rgba(240, 106, 31, .08), transparent 60%); }

/* ---------- календарь серий ---------- */
.sch-head p { max-width: 70ch; }
.sch-days { display: flex; gap: 8px; margin: 18px 0 8px; padding: 2px 2px 10px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 64px; z-index: 3; background: var(--bg); }
.sch-days::-webkit-scrollbar { display: none; }
.sch-days a { flex: none; display: grid; justify-items: center; gap: 1px; min-width: 62px; padding: 8px 10px; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--ring); color: var(--fg); line-height: 1.15; transition: box-shadow .15s, background-color .15s; }
.sch-days a:hover { text-decoration: none; box-shadow: 0 0 0 1px rgba(240, 106, 31, .6); }
.sch-days a span { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sch-days a b { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sch-days a small { color: var(--muted); font-size: .7rem; }
.sch-days a.on { background: #f06a1f; box-shadow: none; color: #fff; }
.sch-days a.on span, .sch-days a.on small { color: rgba(255, 255, 255, .85); }
.sch-day { margin-top: 26px; scroll-margin-top: 150px; }
.sch-date { margin: 0 0 12px; font-size: 1.2rem; font-weight: 750; letter-spacing: -.01em; }
.sch-date .muted { margin-left: 6px; font-size: .9rem; font-weight: 500; }
.sch-day.is-today .sch-date:before { content: ""; display: inline-block; width: 8px; height: 8px; margin: 0 10px 2px 0; border-radius: 50%; background: #f06a1f; box-shadow: 0 0 0 4px rgba(240, 106, 31, .18); }
.sch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.sch-row a { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 12px; background: var(--card); box-shadow: 0 0 0 1px var(--ring); color: var(--fg); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.sch-row a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 10px 24px rgba(0, 0, 0, .25); }
.sch-poster { display: block; width: 52px; aspect-ratio: 2/3; border-radius: 7px; overflow: hidden; background: var(--ph); }
.sch-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sch-body { display: grid; gap: 2px; min-width: 0; }
.sch-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sch-ep { color: var(--muted); font-size: .88rem; }
.sch-where { color: var(--muted); font-size: .78rem; opacity: .85; }
.sch-time { padding: 4px 9px; border-radius: 7px; background: var(--ph-hi); font-size: .8rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sch-row.is-past a { opacity: .8; }
.sch-row.is-past .sch-time { background: transparent; color: var(--muted); font-weight: 600; padding: 0; }
.sch-recent { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.sch-recent .sch-day { margin-top: 18px; }
.sch-recent .sch-date { font-size: 1rem; }
@media (width<=700px) { .sch-days { top: 55px; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; } .sch-day { scroll-margin-top: 140px; } .sch-list { grid-template-columns: 1fr; } }

/* ---------- мой список ---------- */
.my-list .grid:empty { display: none; }
.my-item { position: relative; min-width: 0; }
.my-rm { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--ink-chip); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, background-color .15s; }
.my-item:hover .my-rm, .my-rm:focus-visible { opacity: 1; }
.my-rm:hover { background: #e5534b; }
@media (hover: none) { .my-rm { opacity: 1; } }
.my-empty { padding: 48px 20px; border-radius: var(--r); background: var(--card); box-shadow: 0 0 0 1px var(--ring); text-align: center; }
.my-empty-h { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; }

/* ---------- 404 ---------- */
.err.err-404 { max-width: 640px; margin: 0 auto; padding: 56px 0 8px; text-align: center; }
.err-code { margin: 0; color: var(--muted); font-size: 5.5rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; opacity: .35; font-variant-numeric: tabular-nums; }
.err .err-h { margin: 10px 0 8px; color: var(--fg); font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.err-search { display: flex; gap: 10px; margin: 22px auto 14px; max-width: 520px; }
.err-search input { flex: 1; min-width: 0; padding: 12px 18px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; }
.err-search input:focus { outline: none; border-color: rgba(240, 106, 31, .7); box-shadow: 0 0 0 3px rgba(240, 106, 31, .15); }
.err-search .btn-main { border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 12px 24px; }
.err-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: .92rem; }
.err-links a { color: var(--muted); }
.err-links a:hover { color: var(--accent); }

/* ---------- всплывающая подсказка ---------- */
.kw-toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: #1c1f28; color: #eef0f4; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 18px 40px rgba(0, 0, 0, .45); font-size: .92rem; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.kw-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.kw-toast a { margin-left: 6px; color: #ff9a5c; font-weight: 700; }

/* ---------- подвал ---------- */
.foot { border-top: 1px solid var(--line); }
.foot-col a { transition: color .15s; }
.foot-copy { color: var(--muted); opacity: .8; }

/* фокус с клавиатуры — заметный, но аккуратный */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #f06a1f; outline-offset: 3px; }
