.lf-engine {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 15px;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: "Exo 2", "Segoe UI", Tahoma, Arial, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

.lf-engine:focus {
    outline: 2px solid rgba(142, 80, 255, 0.75);
    outline-offset: 2px;
}

/* Fullscreen: fill viewport and respect safe area */
.lf-engine:fullscreen,
.lf-engine.lf-custom-fullscreen,
.lf-engine:-webkit-full-screen,
.lf-engine:-moz-full-screen,
.lf-engine:-ms-fullscreen {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

.lf-engine.lf-custom-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    aspect-ratio: auto;
    border-radius: 0;
    z-index: 9999;
}

.lf-engine:fullscreen .lf-topbar,
.lf-engine.lf-custom-fullscreen .lf-topbar,
.lf-engine:-webkit-full-screen .lf-topbar,
.lf-engine:-moz-full-screen .lf-topbar,
.lf-engine:-ms-fullscreen .lf-topbar {
    top: max(12px, env(safe-area-inset-top, 0px));
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
}

.lf-engine:fullscreen .lf-bottom,
.lf-engine.lf-custom-fullscreen .lf-bottom,
.lf-engine:-webkit-full-screen .lf-bottom,
.lf-engine:-moz-full-screen .lf-bottom,
.lf-engine:-ms-fullscreen .lf-bottom {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
}

.lf-engine:fullscreen .lf-settings-panel,
.lf-engine.lf-custom-fullscreen .lf-settings-panel,
.lf-engine:-webkit-full-screen .lf-settings-panel,
.lf-engine:-moz-full-screen .lf-settings-panel,
.lf-engine:-ms-fullscreen .lf-settings-panel {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.lf-engine:fullscreen .lf-skip-btn,
.lf-engine:fullscreen .lf-next-btn,
.lf-engine.lf-custom-fullscreen .lf-skip-btn,
.lf-engine.lf-custom-fullscreen .lf-next-btn,
.lf-engine:-webkit-full-screen .lf-skip-btn,
.lf-engine:-webkit-full-screen .lf-next-btn,
.lf-engine:-moz-full-screen .lf-skip-btn,
.lf-engine:-moz-full-screen .lf-next-btn,
.lf-engine:-ms-fullscreen .lf-skip-btn,
.lf-engine:-ms-fullscreen .lf-next-btn {
    right: max(14px, env(safe-area-inset-right, 0px));
}

.lf-engine:fullscreen .lf-skip-btn,
.lf-engine.lf-custom-fullscreen .lf-skip-btn,
.lf-engine:-webkit-full-screen .lf-skip-btn,
.lf-engine:-moz-full-screen .lf-skip-btn,
.lf-engine:-ms-fullscreen .lf-skip-btn {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.lf-engine:fullscreen .lf-ui.lf-has-next-btn .lf-skip-btn,
.lf-engine.lf-custom-fullscreen .lf-ui.lf-has-next-btn .lf-skip-btn,
.lf-engine:-webkit-full-screen .lf-ui.lf-has-next-btn .lf-skip-btn,
.lf-engine:-moz-full-screen .lf-ui.lf-has-next-btn .lf-skip-btn,
.lf-engine:-ms-fullscreen .lf-ui.lf-has-next-btn .lf-skip-btn {
    bottom: calc(148px + env(safe-area-inset-bottom, 0px));
}

.lf-engine:fullscreen .lf-next-btn,
.lf-engine.lf-custom-fullscreen .lf-next-btn,
.lf-engine:-webkit-full-screen .lf-next-btn,
.lf-engine:-moz-full-screen .lf-next-btn,
.lf-engine:-ms-fullscreen .lf-next-btn {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.lf-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.2s ease;
    background: #000;
}

.lf-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.lf-engine.lf-ui-hidden .lf-ui {
    opacity: 0;
    pointer-events: none;
}

/* Пока интерфейс скрыт: не показывать курсор и не оставлять «невидимые» кнопки с pointer/hover поверх видео */
.lf-engine.lf-ui-hidden .lf-ui * {
    pointer-events: none !important;
}

.lf-engine.lf-ui-hidden,
.lf-engine.lf-ui-hidden .lf-video {
    cursor: none;
}

.lf-vast-overlay {
    position: absolute;
    inset: 0;
    z-index: 999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    min-height: 200px;
}

.lf-vast-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.lf-vast-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    min-height: 200px;
}

.lf-vast-countdown {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #eee;
    font-size: 13px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}

.lf-topbar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 5;
}

.lf-chip-wrap {
    position: relative;
    pointer-events: auto;
}

.lf-chip {
    border: 0;
    border-radius: 999px;
    padding: 6px 13px;
    transition: filter 0.2s 
    ease-out, background 0.2s 
    ease-out, opacity 0.2s 
    ease-out;
    background-color: rgba(115, 73, 171, 0.5);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 7px rgba(68, 36, 122, 0.3);
    backdrop-filter: blur(3px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lf-chip-label {
    flex: 0 1 auto;
}

.lf-chip-chevron {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-top: 2px;
    transition: transform 0.2s ease-out;
}

.lf-chip-wrap.lf-chip-open .lf-chip-chevron {
    transform: rotate(180deg);
}

.lf-chip:hover {
    background-color: rgba(151,71,255);
}

.lf-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 160px;
    max-height: 300px;
    overflow: auto;
    background-color: rgba(115, 73, 171, 0.5);
    border-radius: 14px;
    padding: 4px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 15;
}

.lf-menu-item {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 9px 11px;
    text-align: left;
    background: transparent;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.lf-menu-item:hover {
    background: rgba(151,71,255);
}

.lf-menu-item.is-active {
    background: rgba(115, 73, 171, 0.5);
}

.lf-logo {
    display: none;
    margin-left: auto;
    font-size: 23px;
    letter-spacing: 0.05em;
    opacity: 0.84;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.lf-center-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    display: flex;
    align-items: center;
    gap: 18px;
    pointer-events: auto;
    z-index: 9;
}

.lf-circle-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(115, 73, 171, 0.5);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(3px);
    transform-origin: center center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.lf-circle-btn svg {
    width: 78%;
    height: 78%;
    display: block;
}

.lf-circle-btn:hover {
    transform: scale(1.08);
    background: rgba(151, 71, 255);
}

.lf-seek-back,
.lf-seek-forward {
    color: #fff;
    display: inline-flex !important;
    visibility: visible !important;
}

.lf-seek-back svg,
.lf-seek-forward svg {
    position: relative;
    top: 3px;
}

.lf-play-toggle {
    color: #fff;
}

.lf-skip-btn,
.lf-next-btn {
    position: absolute;
    border: 0;
    border-radius: 999px;
    background: rgba(115, 73, 171, 0.5);
    color: #fff;
    padding: 9px 14px;
    font-size: 16px;
    pointer-events: auto;
    cursor: pointer;
    z-index: 8;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
}
.lf-skip-btn:hover,
.lf-next-btn:hover{
    background: rgba(151, 71, 255);
}
.lf-skip-btn {
    right: 14px;
    bottom: 88px;
}

.lf-ui.lf-has-next-btn .lf-skip-btn {
    bottom: 148px;
}

.lf-next-btn {
    right: 14px;
    bottom: 88px;
}

.lf-bottom {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 10px;
    pointer-events: none;
    z-index: 6;
}

.lf-progress-wrap {
    position: relative;
    width: 100%;
    margin: 0 0 5px;
    pointer-events: auto;
    --lf-progress-percent: 0%;
    --lf-progress-played-color: rgb(151 71 255 / 36%);
    --lf-progress-buffered-color: rgb(177 136 232 / 28%);
    --lf-progress-remaining-color: rgb(115 73 171 / 43%);
    --lf-progress-track-height: 10px;
    --lf-progress-thumb-size: 0px;
    --lf-progress-thumb-opacity: 0;
}

.lf-progress-wrap:hover,
.lf-progress-wrap:focus-within {
    --lf-progress-track-height: 14px;
    --lf-progress-thumb-size: 18px;
    --lf-progress-thumb-opacity: 1;
}

.lf-progress-rail,
.lf-progress-buffered-fill,
.lf-progress-played-fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: var(--lf-progress-track-height);
    border-radius: 999px;
    transition: height 0.18s ease, width 0.12s linear;
    backdrop-filter: blur(3px);
}

.lf-progress-rail {
    width: 100%;
    background: var(--lf-progress-remaining-color);
}

.lf-progress-buffered-fill {
    width: 0%;
    background: var(--lf-progress-buffered-color);
}

.lf-progress-played-fill {
    width: 0%;
    background: var(--lf-progress-played-color);
}

.lf-progress {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
    z-index: 3;
}

.lf-progress::-webkit-slider-runnable-track {
    height: var(--lf-progress-track-height);
    border-radius: 999px;
    background: transparent;
    transition: height 0.18s ease;
}

.lf-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--lf-progress-thumb-size);
    height: var(--lf-progress-thumb-size);
    border-radius: 50%;
    border: 0;
    background: #fff;
    margin-top: calc((var(--lf-progress-track-height) - var(--lf-progress-thumb-size)) / 2);
    opacity: var(--lf-progress-thumb-opacity);
    transition: width 0.18s ease, height 0.18s ease, opacity 0.18s ease, margin-top 0.18s ease;
}

.lf-progress::-moz-range-track,
.lf-progress::-moz-range-progress {
    height: var(--lf-progress-track-height);
    border-radius: 999px;
    background: transparent;
    transition: height 0.18s ease;
}

.lf-progress::-moz-range-thumb {
    width: var(--lf-progress-thumb-size);
    height: var(--lf-progress-thumb-size);
    border-radius: 50%;
    border: 0;
    background: #fff;
    opacity: var(--lf-progress-thumb-opacity);
    transition: width 0.18s ease, height 0.18s ease, opacity 0.18s ease;
}

.lf-time-row {
    display: flex;
    gap: 6px;
    align-items: center;
    pointer-events: auto;
    padding-right: 0;
}

.lf-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-height: 54px;
    pointer-events: auto;
}

.lf-time-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    flex-shrink: 0;
}

.lf-time-row,
.lf-volume-control,
.lf-actions {
    min-height: 54px;
    display: flex;
    align-items: center;
}

.lf-volume-control,
.lf-actions {
    flex-shrink: 0;
}

.lf-time-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(115, 73, 171, 0.38);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(3px);
}

.lf-volume-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 0;
    padding-left: 52px;
    pointer-events: auto;
}

.lf-volume-btn {
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -17.5px;
}

.lf-volume-btn:hover {
    transform: scale(1.12);
}

.lf-volume-btn svg {
    width: 72%;
    height: 72%;
}

.lf-volume-wrap {
    position: relative;
    width: 92px;
    height: 16px;
    --lf-volume-percent: 100%;
    --lf-volume-played-color: rgb(177 136 232 / 28%);
    --lf-volume-remaining-color: rgb(115 73 171 / 43%);
    --lf-volume-track-height: 10px;
    --lf-volume-thumb-size: 0px;
    --lf-volume-thumb-opacity: 0;
}

.lf-volume-wrap:hover,
.lf-volume-wrap:focus-within {
    --lf-volume-track-height: 14px;
    --lf-volume-thumb-size: 16px;
    --lf-volume-thumb-opacity: 1;
}

.lf-volume-rail,
.lf-volume-fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: var(--lf-volume-track-height);
    border-radius: 999px;
    transition: height 0.18s ease, width 0.12s linear;
    backdrop-filter: blur(3px);
}

.lf-volume-rail {
    width: 100%;
    background: var(--lf-volume-remaining-color);
}

.lf-volume-fill {
    width: var(--lf-volume-percent);
    background: var(--lf-volume-played-color);
}

.lf-volume-range {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    z-index: 3;
}

.lf-volume-range::-webkit-slider-runnable-track {
    height: var(--lf-volume-track-height);
    border-radius: 999px;
    background: transparent;
    transition: height 0.18s ease;
}

.lf-volume-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--lf-volume-thumb-size);
    height: var(--lf-volume-thumb-size);
    border-radius: 50%;
    border: 0;
    background: #fff;
    margin-top: calc((var(--lf-volume-track-height) - var(--lf-volume-thumb-size)) / 2);
    opacity: var(--lf-volume-thumb-opacity);
    transition: width 0.18s ease, height 0.18s ease, opacity 0.18s ease, margin-top 0.18s ease;
}

.lf-volume-range::-moz-range-track,
.lf-volume-range::-moz-range-progress {
    height: var(--lf-volume-track-height);
    border-radius: 999px;
    background: transparent;
    transition: height 0.18s ease;
}

.lf-volume-range::-moz-range-thumb {
    width: var(--lf-volume-thumb-size);
    height: var(--lf-volume-thumb-size);
    border-radius: 50%;
    border: 0;
    background: #fff;
    opacity: var(--lf-volume-thumb-opacity);
    transition: width 0.18s ease, height 0.18s ease, opacity 0.18s ease;
}

.lf-watermark {
    display: none !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 0.02em;
    opacity: 0.6;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
    pointer-events: none;
}

.lf-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    pointer-events: auto;
}

.lf-icon-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(115, 73, 171, 0.42);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    transform-origin: center center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.lf-icon-btn svg {
    width: 62%;
    height: 62%;
    display: block;
}

.lf-icon-btn:hover {
    transform: scale(1.12);
    background: rgba(151, 71, 255, 0.82);
}
.lf-settings-panel {
    position: absolute;
    right: 12px;
    bottom: 64px;
    width: min(280px, calc(100% - 24px));
    background: rgba(115, 73, 171, 0.5);
    border-radius: 15px;
    padding: 6px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    z-index: 12;
}

.lf-settings-title {
    padding: 8px 11px;
    font-size: 15px;
    opacity: 0.88;
    background: rgba(115, 73, 171, 0.5);
    border-radius: 14px;
}

.lf-settings-row,
.lf-settings-back,
.lf-settings-choice {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-align: left;
    font-size: 17px;
    padding: 9px 11px;
}

.lf-settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.lf-settings-row-value {
    opacity: 0.92;
}

.lf-settings-row:hover,
.lf-settings-back:hover,
.lf-settings-choice:hover {
    background: rgba(151, 71, 255);
}

.lf-settings-choice.is-active {
    background: rgba(115, 73, 171, 0.5);
}

.lf-settings-empty {
    padding: 9px 11px;
    opacity: 0.82;
    font-size: 15px;
}

.lf-error,
.lf-loading {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 16px;
    z-index: 20;
    max-width: calc(100% - 32px);
    text-align: center;
}

.lf-error {
    background: rgba(162, 40, 40, 0.9);
}

@media (max-width: 860px) {
    .lf-chip {
        font-size: 14px;
        padding: 6px 11px;
    }

    .lf-circle-btn {
        width: 45px;
        height: 45px;
    }

    .lf-watermark {
        font-size: 16px;
        bottom: 26px;
    }

    .lf-time-chip {
        font-size: 12px;
        font-weight: 600;
        min-width: 42px;
        padding: 4px 6px;
    }

    .lf-volume-wrap {
        width: 74px;
    }

    .lf-icon-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 640px) {
    .lf-topbar {
        top: 8px;
        left: 8px;
        right: 8px;
        gap: 6px;
        z-index: 10;
    }

    /* Раскрывающиеся списки: скролл работает */
    .lf-engine .lf-menu {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Папки: сохраняем прежнее ограничение */
    .lf-engine .lf-menu.lf-folder-menu {
        max-height: 150px !important;
    }

    /* Серии: ограничиваем высоту списком "примерно на половину" высоты плеера */
    .lf-engine .lf-menu.lf-episode-menu {
        max-height: calc(var(--lf-player-height, 300px) * 0.5) !important;
    }

    /* Кнопки Плей/перемотка по центру по вертикали */
    .lf-engine .lf-center-controls {
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 5;
    }

    /* В полноэкранном режиме — центрирование и порядок как обычно */
    .lf-engine:fullscreen .lf-center-controls,
    .lf-engine.lf-custom-fullscreen .lf-center-controls,
    .lf-engine:-webkit-full-screen .lf-center-controls,
    .lf-engine:-moz-full-screen .lf-center-controls,
    .lf-engine:-ms-fullscreen .lf-center-controls {
        top: 50%;
        transform: translate(-50%, -52%);
        z-index: 9;
    }

    /* Неразвёрнутый плеер на телефоне: папка/серия, время справа сверху, Плей/перемотка, Полный экран */
    .lf-engine .lf-skip-btn,
    .lf-engine .lf-next-btn {
        display: none !important;
    }
    /* Время справа сверху; громкость — слева от полосы (ниже) */
    .lf-engine .lf-time-volume {
        position: static;
        display: block !important;
    }
    .lf-engine .lf-time-volume .lf-time-row {
        position: absolute;
        top: 8px;
        right: 8px;
        left: auto;
        bottom: auto;
        min-height: 28px;
        align-items: center;
    }
    .lf-engine .lf-time-volume .lf-volume-control {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        bottom: 10px;
        left: 12px;
        padding-left: 0;
        height: 44px;
        min-height: 44px;
        z-index: 10;
    }
    .lf-engine .lf-time-volume .lf-volume-btn {
        position: static;
        margin-top: 0;
        top: auto;
    }
    .lf-engine .lf-time-volume .lf-volume-wrap {
        display: none !important;
    }
    /* Полоса перемотки: одинаковые отступы от кнопки звука и от кнопки «Развернуть» (по 8px) */
    .lf-engine .lf-progress-wrap {
        display: flex !important;
        align-items: center;
        position: absolute;
        bottom: 10px;
        left: 64px;
        width: calc(100% - 64px - 8px - 48px - 8px) !important;
        max-width: none;
        right: auto;
        margin: 0;
        min-height: 44px;
        box-sizing: border-box;
        z-index: 10;
    }
    /* Кнопка «Развернуть на весь экран» справа, на одной линии с полосой */
    .lf-engine .lf-actions {
        position: absolute;
        right: 8px;
        bottom: 10px;
        left: auto;
        min-height: 44px;
        align-items: center;
        z-index: 10;
    }
    /* Нижний блок в потоке, чтобы время и таймлайн позиционировались относительно .lf-ui */
    .lf-engine .lf-bottom {
        position: static;
    }
    .lf-engine .lf-settings-btn {
        display: none !important;
    }
    .lf-engine .lf-bottom-bar {
        min-height: 44px;
        justify-content: flex-end;
    }

    /* В полноэкранном режиме — полный набор элементов */
    .lf-engine:fullscreen .lf-skip-btn,
    .lf-engine.lf-custom-fullscreen .lf-skip-btn,
    .lf-engine:-webkit-full-screen .lf-skip-btn,
    .lf-engine:-moz-full-screen .lf-skip-btn,
    .lf-engine:-ms-fullscreen .lf-skip-btn,
    .lf-engine:fullscreen .lf-next-btn,
    .lf-engine.lf-custom-fullscreen .lf-next-btn,
    .lf-engine:-webkit-full-screen .lf-next-btn,
    .lf-engine:-moz-full-screen .lf-next-btn,
    .lf-engine:-ms-fullscreen .lf-next-btn {
        display: inline-flex !important;
    }
    .lf-engine:fullscreen .lf-bottom,
    .lf-engine.lf-custom-fullscreen .lf-bottom,
    .lf-engine:-webkit-full-screen .lf-bottom,
    .lf-engine:-moz-full-screen .lf-bottom,
    .lf-engine:-ms-fullscreen .lf-bottom {
        position: absolute;
    }
    .lf-engine:fullscreen .lf-time-volume,
    .lf-engine.lf-custom-fullscreen .lf-time-volume,
    .lf-engine:-webkit-full-screen .lf-time-volume,
    .lf-engine:-moz-full-screen .lf-time-volume,
    .lf-engine:-ms-fullscreen .lf-time-volume {
        position: static;
        min-height: 54px;
    }
    .lf-engine:fullscreen .lf-time-volume .lf-time-row,
    .lf-engine.lf-custom-fullscreen .lf-time-volume .lf-time-row,
    .lf-engine:-webkit-full-screen .lf-time-volume .lf-time-row,
    .lf-engine:-moz-full-screen .lf-time-volume .lf-time-row,
    .lf-engine:-ms-fullscreen .lf-time-volume .lf-time-row {
        position: static;
    }
    .lf-engine:fullscreen .lf-time-volume .lf-volume-control,
    .lf-engine.lf-custom-fullscreen .lf-time-volume .lf-volume-control,
    .lf-engine:-webkit-full-screen .lf-time-volume .lf-volume-control,
    .lf-engine:-moz-full-screen .lf-time-volume .lf-volume-control,
    .lf-engine:-ms-fullscreen .lf-time-volume .lf-volume-control {
        position: static;
        display: inline-flex !important;
        padding-left: 52px;
    }
    .lf-engine:fullscreen .lf-time-volume .lf-volume-wrap,
    .lf-engine.lf-custom-fullscreen .lf-time-volume .lf-volume-wrap,
    .lf-engine:-webkit-full-screen .lf-time-volume .lf-volume-wrap,
    .lf-engine:-moz-full-screen .lf-time-volume .lf-volume-wrap,
    .lf-engine:-ms-fullscreen .lf-time-volume .lf-volume-wrap {
        display: block !important;
    }
    .lf-engine:fullscreen .lf-progress-wrap,
    .lf-engine.lf-custom-fullscreen .lf-progress-wrap,
    .lf-engine:-webkit-full-screen .lf-progress-wrap,
    .lf-engine:-moz-full-screen .lf-progress-wrap,
    .lf-engine:-ms-fullscreen .lf-progress-wrap {
        display: block !important;
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        max-width: none;
        min-height: 0;
        margin: 0 0 5px;
    }
    .lf-engine:fullscreen .lf-time-volume,
    .lf-engine.lf-custom-fullscreen .lf-time-volume,
    .lf-engine:-webkit-full-screen .lf-time-volume,
    .lf-engine:-moz-full-screen .lf-time-volume,
    .lf-engine:-ms-fullscreen .lf-time-volume {
        display: flex !important;
    }
    .lf-engine:fullscreen .lf-settings-btn,
    .lf-engine.lf-custom-fullscreen .lf-settings-btn,
    .lf-engine:-webkit-full-screen .lf-settings-btn,
    .lf-engine:-moz-full-screen .lf-settings-btn,
    .lf-engine:-ms-fullscreen .lf-settings-btn {
        display: inline-flex !important;
    }
    .lf-engine:fullscreen .lf-bottom-bar,
    .lf-engine.lf-custom-fullscreen .lf-bottom-bar,
    .lf-engine:-webkit-full-screen .lf-bottom-bar,
    .lf-engine:-moz-full-screen .lf-bottom-bar,
    .lf-engine:-ms-fullscreen .lf-bottom-bar {
        justify-content: space-between;
    }
    .lf-engine:fullscreen .lf-actions,
    .lf-engine.lf-custom-fullscreen .lf-actions,
    .lf-engine:-webkit-full-screen .lf-actions,
    .lf-engine:-moz-full-screen .lf-actions,
    .lf-engine:-ms-fullscreen .lf-actions {
        position: static;
    }

    .lf-logo {
        font-size: 18px;
    }

    .lf-watermark {
        display: none;
    }

    .lf-time-row {
        gap: 5px;
    }

    .lf-time-chip {
        font-size: 11px;
        min-width: 40px;
        padding: 3px 6px;
    }

    .lf-volume-wrap {
        width: 58px;
    }

    .lf-skip-btn,
    .lf-next-btn {
        font-size: 14px;
        padding: 7px 10px;
    }

    .lf-skip-btn {
        bottom: 88px;
    }

    .lf-ui.lf-has-next-btn .lf-skip-btn {
        bottom: 128px;
    }

    .lf-next-btn {
        bottom: 68px;
    }

    .lf-engine:fullscreen .lf-next-btn,
    .lf-engine.lf-custom-fullscreen .lf-next-btn,
    .lf-engine:-webkit-full-screen .lf-next-btn,
    .lf-engine:-moz-full-screen .lf-next-btn,
    .lf-engine:-ms-fullscreen .lf-next-btn {
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    }

    .lf-engine:fullscreen .lf-ui.lf-has-next-btn .lf-skip-btn,
    .lf-engine.lf-custom-fullscreen .lf-ui.lf-has-next-btn .lf-skip-btn,
    .lf-engine:-webkit-full-screen .lf-ui.lf-has-next-btn .lf-skip-btn,
    .lf-engine:-moz-full-screen .lf-ui.lf-has-next-btn .lf-skip-btn,
    .lf-engine:-ms-fullscreen .lf-ui.lf-has-next-btn .lf-skip-btn {
        bottom: calc(128px + env(safe-area-inset-bottom, 0px));
    }
}

/* Short viewport (e.g. landscape phone): keep UI inside screen, scrollable settings */
@media (max-height: 420px) {
    .lf-topbar {
        top: 6px;
        left: 8px;
        right: 8px;
    }

    .lf-bottom {
        bottom: 6px;
        left: 8px;
        right: 8px;
    }

    .lf-settings-panel {
        bottom: 56px;
        max-height: min(280px, 60vh);
        overflow-y: auto;
    }

    .lf-skip-btn {
        bottom: 56px;
    }

    .lf-ui.lf-has-next-btn .lf-skip-btn {
        bottom: 96px;
    }

    .lf-next-btn {
        bottom: 56px;
    }
}

/* Short viewport + fullscreen: same reduced layout with safe area */
@media (max-height: 420px) {
    .lf-engine:fullscreen .lf-topbar,
    .lf-engine.lf-custom-fullscreen .lf-topbar,
    .lf-engine:-webkit-full-screen .lf-topbar,
    .lf-engine:-moz-full-screen .lf-topbar,
    .lf-engine:-ms-fullscreen .lf-topbar {
        top: max(6px, env(safe-area-inset-top, 0px));
    }

    .lf-engine:fullscreen .lf-bottom,
    .lf-engine.lf-custom-fullscreen .lf-bottom,
    .lf-engine:-webkit-full-screen .lf-bottom,
    .lf-engine:-moz-full-screen .lf-bottom,
    .lf-engine:-ms-fullscreen .lf-bottom {
        bottom: max(6px, env(safe-area-inset-bottom, 0px));
    }

    .lf-engine:fullscreen .lf-settings-panel,
    .lf-engine.lf-custom-fullscreen .lf-settings-panel,
    .lf-engine:-webkit-full-screen .lf-settings-panel,
    .lf-engine:-moz-full-screen .lf-settings-panel,
    .lf-engine:-ms-fullscreen .lf-settings-panel {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        max-height: min(280px, 60vh);
        overflow-y: auto;
    }

    .lf-engine:fullscreen .lf-skip-btn,
    .lf-engine.lf-custom-fullscreen .lf-skip-btn,
    .lf-engine:-webkit-full-screen .lf-skip-btn,
    .lf-engine:-moz-full-screen .lf-skip-btn,
    .lf-engine:-ms-fullscreen .lf-skip-btn {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    .lf-engine:fullscreen .lf-ui.lf-has-next-btn .lf-skip-btn,
    .lf-engine.lf-custom-fullscreen .lf-ui.lf-has-next-btn .lf-skip-btn,
    .lf-engine:-webkit-full-screen .lf-ui.lf-has-next-btn .lf-skip-btn,
    .lf-engine:-moz-full-screen .lf-ui.lf-has-next-btn .lf-skip-btn,
    .lf-engine:-ms-fullscreen .lf-ui.lf-has-next-btn .lf-skip-btn {
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    .lf-engine:fullscreen .lf-next-btn,
    .lf-engine.lf-custom-fullscreen .lf-next-btn,
    .lf-engine:-webkit-full-screen .lf-next-btn,
    .lf-engine:-moz-full-screen .lf-next-btn,
    .lf-engine:-ms-fullscreen .lf-next-btn {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }
}
