/* Свой видеоплеер (assets/js/player.js) — только на компьютере, на телефоне остаётся системный.
   Рамка по размеру самого ролика: вертикальное видео не растягивается в 16:9, кнопки лежат точно поверх кадра. */
.vp {
  --vp-accent: #79b99c;
  position: relative; width: fit-content; max-width: 100%; margin-inline: auto;
  border-radius: var(--radius-sm); overflow: hidden; background: #000; color: #fff;
  isolation: isolate; outline: none; user-select: none;
}
.vp:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.vp video { display: block; cursor: pointer; }
.vp.is-idle, .vp.is-idle video { cursor: none; }
.vp.is-full { display: flex; align-items: center; justify-content: center; border-radius: 0; }
.vp.is-full video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; border-radius: 0; }

.vp__ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vp__ico .fill { fill: currentColor; }
/* тень — чтобы кнопки читались и на светлом кадре */
.vp__bar .vp__ico { filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .55)); }
.vp__time, .vp__speed { text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }

.vp__big { position: absolute; left: 50%; top: 50%; z-index: 2; width: 72px; height: 72px; margin: -36px 0 0 -36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; transition: transform .15s, background .15s, opacity .2s; }
.vp__big .vp__ico { width: 34px; height: 34px; }
.vp__big .vp__ico .fill { transform: translateX(1.5px); }
.vp__big:hover { background: var(--accent); transform: scale(1.06); }
.vp__big:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.vp:not(.is-paused) .vp__big, .vp.is-error .vp__big { opacity: 0; pointer-events: none; }

.vp__spin { position: absolute; left: 50%; top: 50%; z-index: 2; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: vp-spin .8s linear infinite; display: none; pointer-events: none; }
.vp.is-waiting:not(.is-paused) .vp__spin { display: block; }
@keyframes vp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .vp__spin { animation-duration: 2.4s; } }

.vp__error { position: absolute; left: 16px; right: 16px; top: 50%; z-index: 2; transform: translateY(-50%); margin: 0; text-align: center; font-weight: 600; }

/* панель снизу */
.vp__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 40px 10px 6px; background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .62) 45%, rgba(0, 0, 0, 0)); transition: opacity .2s; }
.vp.is-fresh .vp__bar, .vp.is-idle .vp__bar, .vp.is-error .vp__bar { opacity: 0; pointer-events: none; }
.vp__row { display: flex; align-items: center; gap: 2px; }
.vp__btn { flex: none; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: #fff; cursor: pointer; }
.vp__btn:hover { background: rgba(255, 255, 255, .15); }
.vp__btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.vp__speed { width: auto; min-width: 44px; padding: 0 8px; font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.vp__time { margin-left: 6px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .92; }
.vp__gap { flex: 1; }
.vp__volume { display: flex; align-items: center; gap: 4px; }

/* громкость: заливка до текущего значения через --level */
.vp__level { -webkit-appearance: none; appearance: none; width: 72px; height: 4px; margin: 0 6px 0 0; border-radius: 2px; background: linear-gradient(to right, #fff var(--level, 50%), rgba(255, 255, 255, .3) 0); cursor: pointer; }
.vp__level::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.vp__level::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.vp__level::-moz-range-track { background: transparent; }
.vp__level:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* полоса перемотки */
.vp__track { position: relative; height: 18px; margin: 0 6px 2px; cursor: pointer; touch-action: none; }
.vp__track::before, .vp__buffered, .vp__played { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; transition: height .12s, margin .12s; }
.vp__track::before { content: ''; right: 0; background: rgba(255, 255, 255, .28); }
.vp__buffered { width: 0; background: rgba(255, 255, 255, .45); }
.vp__played { width: 0; background: var(--vp-accent); }
.vp__track:hover::before, .vp__track:hover .vp__buffered, .vp__track:hover .vp__played,
.vp.is-seeking .vp__track::before, .vp.is-seeking .vp__buffered, .vp.is-seeking .vp__played { height: 6px; margin-top: -3px; }
.vp__knob { position: absolute; left: 0; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--vp-accent); transform: scale(0); transition: transform .12s; }
.vp__track:hover .vp__knob, .vp__track:focus-visible .vp__knob, .vp.is-seeking .vp__knob { transform: scale(1); }
.vp__track:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.vp__tip { position: absolute; bottom: 20px; left: 0; transform: translateX(-50%); padding: 2px 7px; border-radius: 5px; background: rgba(0, 0, 0, .82); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }

.vp.is-narrow .vp__level, .vp.is-narrow .vp__pip { display: none; }
