/* Свой видеоплеер уроков (js/lesson-player.js). Цвета — токены страницы (--acc, --ink), запасные значения — фирменные. */
.lp { --lp-acc: var(--acc, #46a074); --lp-acc2: var(--acc2, #7fd3a6); --lp-ink: #f6f3ec;
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #050c08; border-radius: 24px; overflow: hidden; isolation: isolate;
  box-shadow: 0 40px 100px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.1);   /* рамка видео как на лендинге /ornament/ (.vid) */ color: var(--lp-ink); outline: none; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.lp:focus-visible { box-shadow: 0 0 0 2px var(--lp-acc2), 0 30px 80px rgba(0,0,0,.45); }
.lp-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #050c08; z-index: 0; -webkit-touch-callout: none; }
.lp.lp-fs-on { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; height: 100dvh; box-shadow: none; }
.lp:fullscreen { border-radius: 0; aspect-ratio: auto; }

/* Крупная кнопка play по центру кадра: фирменное зелёное «стекло» — тёмный полупрозрачный круг с размытием, тонкая обводка #46a074 и мягкое свечение, белый треугольник со сдвигом
   к оптическому центру. Появление/исчезновение — opacity + scale (.86 → 1, ease-out), при наведении мышью +6 % и сильнее свечение. Лежит выше панели управления. */
.lp-big { position: absolute; inset: 0; margin: auto; z-index: 5; width: 72px; height: 72px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: rgba(6,22,15,.55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.75px #46a074, 0 0 22px rgba(70,160,116,.4), 0 8px 28px rgba(0,0,0,.35);
  transition: transform .28s cubic-bezier(.23, 1, .32, 1), box-shadow .28s cubic-bezier(.23, 1, .32, 1), opacity .24s cubic-bezier(.23, 1, .32, 1); }
.lp-big svg { width: 30px; height: 30px; margin-left: 4px; display: block; }
.lp[data-state="ended"] .lp-big svg { margin-left: 0; }
@media (hover: hover) and (pointer: fine) { .lp-big:hover { transform: scale(1.06); box-shadow: inset 0 0 0 1.75px #5fc491, 0 0 34px rgba(95,196,145,.6), 0 8px 28px rgba(0,0,0,.35); } }
.lp-big:active { transform: scale(.96); }
.lp-big:focus-visible { outline: 3px solid var(--lp-acc2); outline-offset: 4px; }
.lp[data-state="playing"] .lp-big { opacity: 0; pointer-events: none; transform: scale(.86); transition-duration: .18s; }
@media (prefers-reduced-motion: reduce) { .lp-big, .lp-big:hover { transition: opacity .15s linear; transform: none; } }

/* Панель управления */
.lp-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 40px 14px 8px;
  background: linear-gradient(to top, rgba(3,10,6,.88) 0%, rgba(3,10,6,.6) 45%, rgba(3,10,6,0) 100%);
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .22s, transform .22s; }
.lp.lp-show .lp-controls, .lp[data-state="paused"] .lp-controls, .lp[data-state="ended"] .lp-controls { opacity: 1; transform: none; pointer-events: auto; }
.lp[data-state="playing"]:not(.lp-show) { cursor: none; }

/* Перемотка */
.lp-seek { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.lp-track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); overflow: hidden; transition: height .15s; }
.lp-seek:hover .lp-track, .lp-seek.lp-drag .lp-track, .lp-seek:focus-visible .lp-track { height: 7px; }
.lp-buf { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,255,255,.3); }
.lp-played { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--lp-acc), var(--lp-acc2)); }
.lp-ticks { position: absolute; inset: 0; pointer-events: none; }
.lp-tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(3,10,6,.85); }
.lp-thumb { position: absolute; top: 50%; left: 0; width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.5);
  transform: scale(0); transition: transform .15s; pointer-events: none; }
.lp-seek:hover .lp-thumb, .lp-seek.lp-drag .lp-thumb, .lp-seek:focus-visible .lp-thumb { transform: scale(1); }
.lp-seek:focus-visible { box-shadow: 0 0 0 2px var(--lp-acc2); border-radius: 6px; }
.lp-tip { position: absolute; bottom: 24px; left: 0; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px; background: rgba(8,18,12,.94); box-shadow: 0 6px 20px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.1);
  font: 600 12.5px/1.3 Onest, system-ui, sans-serif; white-space: nowrap; pointer-events: none; text-align: center; }
.lp-tip b { display: block; font: 700 13px 'JetBrains Mono', ui-monospace, monospace; }
.lp-tip span { display: block; color: #cfc9bb; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.lp-tip span:empty { display: none; }

/* Нижний ряд */
.lp-row { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.lp-btn { flex: none; width: 42px; height: 42px; border: 0; border-radius: 10px; background: none; color: #fff; cursor: pointer; display: grid; place-items: center; font: 700 13.5px 'JetBrains Mono', ui-monospace, monospace; transition: background .15s, transform .15s; }
.lp-btn svg { width: 24px; height: 24px; }
.lp-btn:hover { background: rgba(255,255,255,.14); }
.lp-btn:active { transform: scale(.92); }
.lp-btn:focus-visible { outline: 2px solid var(--lp-acc2); outline-offset: 1px; }
.lp-play { width: 46px; }
.lp-play svg { width: 26px; height: 26px; }
.lp-time { flex: none; display: flex; gap: 4px; margin: 0 10px 0 4px; font: 600 13px 'JetBrains Mono', ui-monospace, monospace; color: #e8e4d8; letter-spacing: .02em; white-space: nowrap; }
.lp-time i { font-style: normal; opacity: .5; }
.lp-chapter { flex: 1 1 auto; min-width: 0; padding: 0 10px; font: 600 14px Onest, system-ui, sans-serif; color: var(--lp-acc2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-spacer { display: none; }
.lp-speed { width: auto; min-width: 46px; padding: 0 8px; }
.lp-speedwrap { position: relative; flex: none; }
.lp-speedwrap[hidden] { display: none; }
.lp-qual { width: 42px; padding: 0; }
.lp-qmenu { min-width: 184px; }
.lp-qmenu .lp-menu-item { white-space: nowrap; }
.lp-hold { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; pointer-events: none; background: #050c08; }
.lp-menu { position: absolute; right: 0; bottom: 50px; min-width: 132px; padding: 6px; border-radius: 12px; background: rgba(8,18,12,.97); box-shadow: 0 12px 36px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.12); z-index: 6; }
.lp-menu-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: #f6f3ec; cursor: pointer; font: 600 14px Onest, system-ui, sans-serif; text-align: left; }
.lp-menu-item:hover, .lp-menu-item:focus-visible { background: rgba(255,255,255,.1); outline: none; }
.lp-menu-item.on { color: var(--lp-acc2); }
.lp-menu-item.on::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--lp-acc2); }
.lp-volwrap { display: flex; align-items: center; flex: none; }
.lp-vol { -webkit-appearance: none; appearance: none; width: 0; height: 4px; margin: 0; padding: 0; border-radius: 4px; background: linear-gradient(to right, #fff var(--lp-v, 100%), rgba(255,255,255,.28) var(--lp-v, 100%)); cursor: pointer; opacity: 0; transition: width .2s, opacity .2s, margin .2s; }
.lp-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 6px rgba(0,0,0,.5); }
.lp-vol::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; }
.lp-vol:focus-visible { outline: 2px solid var(--lp-acc2); outline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
  .lp-volwrap:hover .lp-vol, .lp-volwrap:focus-within .lp-vol { width: 84px; margin: 0 10px 0 4px; opacity: 1; }
}

/* Загрузка, ошибка, подсказка */
.lp-spin { position: absolute; left: 50%; top: 50%; z-index: 2; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--lp-acc2); animation: lpSpin .9s linear infinite; pointer-events: none; }
@keyframes lpSpin { to { transform: rotate(360deg); } }
.lp-err { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: rgba(5,12,8,.86); }
.lp-err p { max-width: 420px; font: 500 16px/1.5 Onest, system-ui, sans-serif; color: #f6f3ec; }
.lp-retry { min-height: 46px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer; font: 700 15px Onest, system-ui, sans-serif; color: #fff; background: linear-gradient(135deg, #3f9a6f, #2f7351); box-shadow: inset 0 0 0 1px rgba(127,211,166,.5), 0 8px 24px rgba(47,115,81,.5); }
.lp-retry:focus-visible { outline: 3px solid var(--lp-acc2); outline-offset: 3px; }
.lp-toast { position: absolute; left: 14px; bottom: 84px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 999px; background: rgba(8,18,12,.94); box-shadow: 0 8px 24px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.12); font: 600 13.5px Onest, system-ui, sans-serif; }
.lp-toast-btn { min-height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; font: 700 13px Onest, system-ui, sans-serif; }
.lp-toast-btn:hover { background: rgba(255,255,255,.22); }
.lp-toast[hidden], .lp-spin[hidden], .lp-err[hidden], .lp-menu[hidden], .lp-tip[hidden] { display: none; }

/* Узкие экраны и палец: крупные цели, главу показываем отдельной строкой над рядом кнопок */
@media (max-width: 720px) {
  .lp { border-radius: 16px; }
  .lp-controls { padding: 28px 8px 4px; }
  .lp-chapter { display: none; }
  .lp-time { margin-left: auto; margin-right: auto; }
  .lp-pip { display: none; }
  .lp-big { width: 56px; height: 56px; }   /* на узком кадре (354×199) панель управления занимает нижнюю половину: кнопка меньше, лежит над панелью */
  .lp-big svg { width: 24px; height: 24px; margin-left: 3px; }
  .lp-toast { top: 10px; bottom: auto; left: 8px; }   /* вверху кадра: внизу он перекрывал бы центр с кнопкой play */
  /* меню (скорость, качество) на телефоне — лист поверх панели внутри кадра, пункты в два столбца: кадр 354×199 слишком низкий для столбика из пяти строк */
  .lp-speedwrap { position: static; }
  .lp-menu { left: 8px; right: 8px; bottom: 8px; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; z-index: 7; }
  .lp-menu[hidden] { display: none; }
}
@media (pointer: coarse) {
  .lp-btn { width: 46px; height: 46px; }
  .lp-row { min-height: 48px; }
  .lp-seek { height: 30px; }
  .lp-track { height: 6px; }
  .lp-thumb { transform: scale(1); width: 18px; height: 18px; margin: -9px 0 0 -9px; }
  .lp-vol { display: none; }
  .lp-menu-item { padding: 13px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .lp *, .lp *::before, .lp *::after { transition: none !important; }
  .lp-spin { animation-duration: 2.4s; }
}
