﻿/* Режим ведущего и автопоказ (ТЗ, 2.2, 3.5, 12). Все размеры — в единицах холста 1600×900. */

#stage { --pr-dim: 0.42; }

.pr-root, .ks-root { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.pr-root [hidden], .ks-root[hidden], .ks-root [hidden] { display: none !important; }

/* ——— «Лазерная» подсветка (12.2) ——— */
.pr-spot {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  border-radius: 12px; border: 2px solid #2BA3B8;
  box-shadow: 0 0 0 6px rgba(43,163,184,0.18), 0 0 0 9999px rgba(11,31,58,var(--pr-dim));
  opacity: 0; pointer-events: none; z-index: 1;
  transition: left 450ms cubic-bezier(0.65,0,0.35,1), top 450ms cubic-bezier(0.65,0,0.35,1),
              width 450ms cubic-bezier(0.65,0,0.35,1), height 450ms cubic-bezier(0.65,0,0.35,1),
              opacity 250ms cubic-bezier(0.55,0,1,0.45);
}
.pr-spot.is-on { opacity: 1; transition-property: left, top, width, height, opacity; transition-duration: 450ms, 450ms, 450ms, 450ms, 300ms; }
.pr-spot.no-move { transition: none; }
.is-broadcast .pr-spot { border-width: 3px; box-shadow: 0 0 0 6px rgba(43,163,184,0.28), 0 0 0 9999px rgba(11,31,58,calc(var(--pr-dim) + 0.08)); }

/* ——— Полоса прогресса 4 px (12.3) ——— */
.pr-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #DDE3EA; z-index: 3; }
.pr-progress__fill { height: 100%; width: 0; background: #1F8A9E; transition: width 450ms cubic-bezier(0.65,0,0.35,1); }
.pr-progress__tick { position: absolute; top: 0; width: 1px; height: 4px; background: rgba(11,31,58,0.25); }

/* ——— Панель подсказки (12.1) ——— */
.pr-panel {
  position: absolute; width: 480px; max-height: 360px; box-sizing: border-box;   /* реплика целиком, без прокрутки; панель сама уходит из‑под подсветки */
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 10px;
  background: rgba(11,31,58,0.92); color: #fff; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(11,31,58,0.28);
  opacity: 0.9; pointer-events: auto; z-index: 5; cursor: grab; user-select: none;
}
.pr-panel:hover { opacity: 1; }
.pr-panel.is-dragging, .pr-fab.is-dragging { cursor: grabbing; transition: none; opacity: 1; }
.pr-panel__head { font-size: 12px; color: #8FC9D6; line-height: 1.3; }
.pr-panel__title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.pr-panel__speech { font-size: 14px; line-height: 1.45; overflow: auto; min-height: 0; flex: 1 1 auto; cursor: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.25) transparent; }
.pr-panel__next { font-size: 13px; color: #AFC3D6; }
.pr-panel__foot { display: flex; align-items: center; gap: 4px; font-size: 12px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.12); }
.pr-panel__spacer { flex: 1; }
.pr-timer { font-variant-numeric: tabular-nums; margin-right: 6px; }
.pr-timer.is-ok { color: #6FCF97; }
.pr-timer.is-late { color: #F2B65A; }
.pr-timer.is-early { color: #5CC6D6; }
.pr-ring { flex: none; }
.pr-ring circle:last-child { transition: stroke-dashoffset 250ms linear; }

.pr-ibtn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent; color: #fff; cursor: pointer; padding: 0;
}
.pr-ibtn:hover { background: rgba(255,255,255,0.12); }
.pr-ibtn.is-active { background: rgba(43,163,184,0.35); }
.pr-ibtn:focus-visible, .pr-chip:focus-visible, .pr-fab:focus-visible { outline: 2px solid #2BA3B8; outline-offset: 1px; }

/* меню настроек панели */
.pr-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  display: flex; flex-direction: column; gap: 8px; padding: 12px 14px;
  background: rgba(11,31,58,0.96); border-radius: 12px; box-shadow: 0 12px 32px rgba(11,31,58,0.28); cursor: default;
}
.pr-corner-tl .pr-menu, .pr-corner-tr .pr-menu { bottom: auto; top: calc(100% + 8px); }
.pr-menu__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: #AFC3D6; }
.pr-menu__row > span { flex: 1 0 100%; }
.pr-chip {
  height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid rgba(255,255,255,0.25);
  background: transparent; color: #fff; font: inherit; font-size: 12px; cursor: pointer;
}
.pr-chip.is-active { background: #1F8A9E; border-color: #1F8A9E; }

/* свёрнутая панель (свободный режим) — кнопка 40 px «Сц» */
.pr-fab {
  position: absolute; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(11,31,58,0.92); color: #fff; font: inherit; font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 16px rgba(11,31,58,0.25); cursor: pointer; pointer-events: auto; z-index: 5; opacity: 0.9;
}
.pr-fab:hover { opacity: 1; }

/* углы: отступ 16 px от краёв и над колонтитулом */
.pr-corner-br .pr-panel, .pr-corner-br .pr-fab { right: 16px; bottom: calc(var(--footer-h, 28px) + 16px); }
.pr-corner-bl .pr-panel, .pr-corner-bl .pr-fab { left: 16px; bottom: calc(var(--footer-h, 28px) + 16px); }
.pr-corner-tr .pr-panel, .pr-corner-tr .pr-fab { right: 16px; top: calc(var(--topbar-h, 56px) + 16px); }
.pr-corner-tl .pr-panel, .pr-corner-tl .pr-fab { left: 16px; top: calc(var(--topbar-h, 56px) + 16px); }

/* ——— Автопоказ (2.2, 3.5) ——— */
.ks-root { z-index: 45; }
.ks-badge {
  position: absolute; top: 12px; right: 16px; padding: 4px 10px; border-radius: 12px;
  font-size: 12px; color: #fff; background: rgba(11,31,58,0.55); letter-spacing: 0.02em;
}
.ks-caption {
  position: absolute; left: 50%; bottom: 48px; max-width: 1240px; transform: translate(-50%, 12px);
  padding: 14px 28px; border-radius: 12px; background: rgba(11,31,58,0.82);
  color: #fff; font-size: 28px; line-height: 1.3; font-weight: 500; text-align: center;
  opacity: 0; transition: opacity 400ms cubic-bezier(0.22,1,0.36,1), transform 400ms cubic-bezier(0.22,1,0.36,1);
}
.ks-caption.is-on { opacity: 1; transform: translate(-50%, 0); }
.ks-caption:empty { display: none; }
.ks-pause {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 640px;
  display: none; flex-direction: column; align-items: center; gap: 18px; padding: 28px 32px;
  border-radius: 16px; background: rgba(11,31,58,0.94); color: #fff; text-align: center;
  font-size: 18px; line-height: 1.5; box-shadow: 0 16px 48px rgba(11,31,58,0.35); pointer-events: auto;
}
.ks-pause.is-on { display: flex; }
.ks-pause__actions { display: flex; gap: 12px; }
.ks-pause__btn {
  height: 40px; padding: 0 18px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.3);
  background: transparent; color: #fff; font: inherit; font-size: 14px; cursor: pointer;
}
.ks-pause__btn.is-primary { background: #1F8A9E; border-color: #1F8A9E; }
.ks-fade { position: absolute; inset: 0; background: #0B1F3A; opacity: 0; transition: opacity 600ms ease; pointer-events: none; }
.ks-fade.is-on { opacity: 1; }
html.ks-nocursor, html.ks-nocursor * { cursor: none !important; }

/* ——— Режим трансляции (7.0, 12.4): длительности ×1,3, без мелкого мерцания ——— */
#stage.is-broadcast { --anim-k: 1.3; --pulse-period: 900ms; }

@media (prefers-reduced-motion: reduce) {
  .pr-spot, .pr-progress__fill, .ks-caption, .ks-fade { transition-duration: 1ms !important; }
}
@media print {
  .pr-root, .ks-root { display: none !important; }
}
