/* Сайт АЛИ МОНТАЖ — фото-пример и выбор стиля субтитров, вид как в приложении АЛИ МОНТАЖ («Кинозал»). 22.10.2026.
   Значения — из файлов приложения (kinozal.css разделы 4, 17, 18, 19, 20; subtitle-controls.css; app-ui.css § 3;
   rhythm-photo.css; subtitle-live.css), переписаны на классы сайта (.stil-*) и знаки /site/tema.css (--bg, --surface,
   --surface-2, --sheet, --line, --text, --muted, --acc, --grad, --bad). Файлы приложения сюда НЕ подключаются.
   Подключается после tema.css. Без Google Fonts и без встроенных стилей (CSP default-src 'self'): шрифты субтитров — копия
   /site/subtitry/ (шаг 5 установки), положение строк и цвета кружков — el.style из subtitry-sloi.js и subtitry.js.
   Кадр — 4:5 (600×750, /site/hero.jpg): строки завода нарисованы под этот кадр, пропорции не менять. */

@font-face {
  font-family: 'Bad Script';
  src: url('/site/subtitry/badscript/BadScript-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.stil { display: block; min-width: 0; }
.stil-kadr { position: relative; }

/* ---------- кадр: фото, строки завода, запасной текст, пилюля «Пример оформления» ---------- */
.stil-stage {
  position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 4 / 5; width: 100%;
  background: var(--surface); color: #FFFFFF;
}
.stil-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; z-index: 0; display: block; }
.stil-sloi { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.stil-sloi canvas { position: absolute; display: block; background: transparent; }
.stil-metka {
  position: absolute; top: 10px; left: 10px; z-index: 4; pointer-events: none;
  background: rgba(16, 12, 15, .52); color: #FFFFFF; font-size: 12.5px; font-weight: 600; line-height: 1.3;
  padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
/* запасной текст — только если строк завода нет (нет копии или нет слоёв этого выбора); строка — с 61 % высоты кадра */
.stil-zapas {
  position: absolute; left: 12px; right: 12px; top: 61%; z-index: 2; margin: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45); --k: 1;
}
.stil-stage[data-sloi="ready"] .stil-zapas { visibility: hidden; }
.stil-stage[data-size="small"] .stil-zapas { --k: .8; }
.stil-stage[data-size="large"] .stil-zapas { --k: 1.2; }
.stil-zapas span, .stil-zapas strong { white-space: nowrap; font-style: normal; font-synthesis: none; letter-spacing: normal; }
.stil-zapas span {
  font-family: var(--pair-support-font, 'Bad Script'), cursive; font-weight: var(--pair-support-weight, 400);
  font-size: calc(22px * var(--k)); color: var(--stil-main, #FFFFFF);
}
.stil-zapas strong {
  font-family: var(--pair-accent-font, 'Bad Script'), cursive; font-weight: var(--pair-accent-weight, 400);
  font-size: calc(44px * var(--k)); color: var(--stil-hl, #FF94C2); text-transform: var(--pair-accent-case, none);
}
/* «Чисто»: обе строки — второстепенным шрифтом пары и основным цветом */
.stil-stage[data-style="2"] .stil-zapas strong {
  font-family: var(--pair-support-font, 'Bad Script'), cursive; font-weight: var(--pair-support-weight, 400);
  font-size: calc(22px * var(--k)); color: var(--stil-main, #FFFFFF); text-transform: none;
}

/* главная: кадр-афиша во всю ширину телефона, внизу затухание в фон 22 % (kinozal.css § 4) */
.stil-home .stil-stage { width: 100vw; margin-left: calc(50% - 50vw); }
.stil-home .stil-stage::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 22%; z-index: 3; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.stil-home .stil-metka { left: max(16px, env(safe-area-inset-left, 0px)); }
/* планшет и компьютер: кадр — карточкой со скруглением 22 (kinozal.css § 20) */
@media (min-width: 600px) {
  .stil-home .stil-stage { width: 100%; margin-left: 0; border-radius: 22px; }
  .stil-home .stil-metka { left: 10px; }
}
/* экран «Видео»: тот же блок компактнее — кадр меньше, без затухания */
.stil-video .stil-stage { width: min(100%, 240px); margin-inline: auto; border-radius: 18px; }

/* ---------- «Чисто | Ритм»: на кадре внизу, матовая плашка (kinozal.css § 4) ---------- */
.stil-vid { display: flex; justify-content: center; position: relative; z-index: 5; margin-top: -48px; }
.stil-video .stil-vid { margin-top: 10px; }
.stil-vid-in {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.stil-vid-in button {
  min-height: 38px; padding: 0 18px; border-radius: 10px; border: 0; background: none; color: var(--muted);
  font: 500 14px/1.2 var(--body); cursor: pointer;
}
.stil-vid-in button[aria-pressed="true"] { background: var(--bg); color: var(--text); font-weight: 600; }
.stil-vid-in button:disabled { cursor: default; }
.stil-zag { margin: 8px 0 0; text-align: center; font-size: 13px; line-height: 1.4; color: var(--muted); }

/* ---------- барабан шрифтов: вбок, выбранный по центру, соседи размыты (app-ui.css § 3, kinozal.css § 18) ---------- */
.stil-baraban { position: relative; height: 52px; margin: 12px 0 10px; isolation: isolate; }
.stil-koleso {
  position: relative; z-index: 1; height: 52px; width: 100%; overflow: hidden; border-radius: 12px; outline: none;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24%, #000 76%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 24%, #000 76%, transparent 100%);
}
.stil-koleso:focus-visible { box-shadow: inset 0 0 0 2px var(--acc); }
.stil-koleso[data-empty] { display: grid; place-items: center; -webkit-mask-image: none; mask-image: none; cursor: default; }
.stil-koleso[data-empty] + .stil-fokus { display: none; }
.stil-koleso[aria-disabled="true"] { cursor: default; }
.stil[data-locked] .stil-koleso { pointer-events: none; }
.stil-pusto { color: var(--muted); font-size: 14px; }
.stil-dorozhka { display: flex; height: 100%; width: 100%; will-change: transform; }
/* соседи — тенью текста, без filter и transform: iPhone не мигает (приложение 01.10) */
.stil-dorozhka [role="option"] {
  flex: 0 0 36%; min-width: 0; height: 52px; padding: 0 4px; display: flex; align-items: center; justify-content: center;
  font: 500 14px/1.2 var(--body); color: transparent; text-shadow: 0 0 .8px var(--muted); opacity: .74; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .2s, color .2s, text-shadow .2s, font-size .2s;
}
.stil-dorozhka [role="option"][data-near="0"] { opacity: 1; color: var(--text); text-shadow: 0 0 0 transparent; font: 600 16px/1.2 var(--display); }
.stil-dorozhka [role="option"]:not([data-near="0"]):not([data-near="1"]) { opacity: 0; }
.stil-fokus { position: absolute; z-index: 0; inset: 6px 33%; height: 40px; pointer-events: none; background: var(--grad) bottom / 34% 2px no-repeat; }
.stil-strelka {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text); font-size: 24px; line-height: 1;
}
.stil-strelka[data-shag="-1"] { left: 0; }
.stil-strelka[data-shag="1"] { right: 0; }
.stil-strelka:disabled { opacity: .3; cursor: default; }

/* ---------- два цвета (kinozal.css § 4, 17, 19) ---------- */
.stil-cveta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.stil-cvet {
  appearance: none; width: 100%; min-width: 0; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border: 0; border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.stil-cvet[aria-expanded="true"] { box-shadow: inset 0 0 0 1.5px var(--acc); }
.stil-cvet:disabled { opacity: .6; cursor: default; }
.stil-krug { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22); }
.stil-cvet-t { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.stil-cvet-k { font-size: 13px; color: var(--muted); }
.stil-cvet-v { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* палитра (kinozal.css § 17, subtitle-controls.css) */
.stil-paleta { margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--surface); color: var(--text); }
.stil-paleta-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.stil-svoj {
  display: inline-flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--acc); font-size: 14px; font-weight: 600;
}
.stil-svoj input { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.stil-svoj input::-webkit-color-swatch-wrapper { padding: 0; }
.stil-svoj input::-webkit-color-swatch { border: 2px solid var(--bg); border-radius: 50%; }
.stil-svoj input::-moz-color-swatch { border: 2px solid var(--bg); border-radius: 50%; }
.stil-setka { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stil-obrazec {
  min-width: 0; min-height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 5px 0; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--text); cursor: pointer; font: inherit;
}
.stil-tochka { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--text) 25%, transparent); }
.stil-tochka svg { width: 16px; height: 16px; fill: none; stroke: var(--check-ink, #292528); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.stil-imya { display: block; max-width: 100%; font-size: 12px; line-height: 1.3; letter-spacing: -.01em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stil-obrazec[aria-pressed="true"] { background: var(--surface-2); border-color: var(--acc); }
.stil-obrazec[aria-pressed="true"] .stil-tochka { outline: 2px solid var(--acc); outline-offset: 2px; }
.stil-obrazec[aria-pressed="true"] svg { opacity: 1; }
.stil-obrazec[aria-pressed="true"] .stil-imya { color: var(--text); font-weight: 600; }
.stil-pipetka { width: 100%; min-height: 44px; margin-top: 8px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--text); font: 600 14px/1.2 var(--body); cursor: pointer; }

/* строка ошибки сохранения (kinozal.css § 4: subtitle-save-status) — видна только ошибка */
.stil-status {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.45;
  background: var(--sheet); color: var(--text); box-shadow: inset 0 0 0 1px var(--line);
}
.stil-status:empty { display: none; }
.stil-status[data-state="error"] { color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }

/* ---------- «Размер букв», «Как появляется текст» ---------- */
.stil-ruchki { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.stil-ruchki label { display: grid; gap: 7px; min-width: 0; font-size: 13px; color: var(--muted); }
.stil-sel { position: relative; display: block; }
.stil-sel::after {
  content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border-right: 1.8px solid var(--text); border-bottom: 1.8px solid var(--text); transform: translateY(-70%) rotate(45deg);
}
.stil-sel select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 50px; padding: 0 34px 0 14px;
  border: 0; border-radius: 14px; background: var(--surface); color: var(--text); font: 500 16px/1.2 var(--body); cursor: pointer;
}
.stil-sel select:disabled { opacity: .6; cursor: default; }

/* экран «Видео»: заголовок блока */
.stil-blok { display: grid; gap: 12px; }

@media (max-width: 360px) {
  .stil-vid-in button { padding: 0 14px; font-size: 13px; }
  .stil-cvet { gap: 8px; padding: 7px 10px; }
}
/* самые узкие телефоны: «Без анимации» не помещается в половину ширины — поля друг под другом (шрифт 16 px: iPhone не
   увеличивает страницу при выборе) */
@media (max-width: 349px) {
  .stil-ruchki { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .stil-dorozhka [role="option"] { transition: none; }
}
