/* =========================================================
   VHP Custom Player — единый плеер (контент + реклама)
   Тёмная тема, декларируется на отдельной странице /video/
   ========================================================= */

#vhp-custom-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    pointer-events: none;
}
#vhp-custom-bar .vhpp-bar { pointer-events: auto; }

.vhp-player-wrapper {
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}
.vhp-player-wrapper.vhpp-ad-mode { cursor: pointer; }

/* ===== Панель управления ===== */
.vhpp-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.55) 65%, rgba(0,0,0,0.85));
    color: #fff;
    font-family: inherit;
    line-height: 1;
    opacity: 1;
    transition: opacity .25s ease;
}
.vhpp-bar, .vhpp-bar * { box-sizing: border-box; }
.vhp-player-wrapper.vhpp-bar-hidden .vhpp-bar { opacity: 0; pointer-events: none; }
.vhp-player-wrapper.vhpp-idle .vhpp-bar,
.vhp-player-wrapper.vhpp-paused .vhpp-bar,
.vhp-player-wrapper.vhpp-ad-mode .vhpp-bar { opacity: 1; pointer-events: auto; }

/* ===== Полоса перемотки ===== */
.vhpp-seek-row { width: 100%; display: flex; align-items: center; }
.vhpp-seek {
    width: 100%;
    height: 4px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.vhpp-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.vhpp-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: none; }

/* ===== Кнопки ===== */
.vhpp-btn-row { display: flex; align-items: center; gap: 4px; }
.vhpp-btn {
    background: none;
    border: none;
    color: #fff;
    min-width: 34px;
    height: 34px;
    padding: 0 4px;
    border-radius: 50%;
    font-size: 16px;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vhpp-btn:hover { background: rgba(255,255,255,0.12); }
.vhpp-btn.vhpp-active { color: #3ea6ff; }
.vhpp-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.vhpp-rew, .vhpp-fwd { line-height: 1; }
.vhpp-rew svg, .vhpp-fwd svg { width: 15px; height: 15px; }
.vhpp-step-text { font-size: 10px; font-weight: 700; letter-spacing: -0.5px; }
.vhpp-time {
    font-size: 12px;
    color: #ddd;
    margin: 0 8px 0 2px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.vhpp-spacer { flex: 1; }

/* ===== Громкость ===== */
.vhpp-vol-wrap { display: flex; align-items: center; gap: 2px; }
.vhpp-vol {
    width: 64px;
    height: 4px;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.vhpp-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: none; }
.vhpp-vol::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: none; }

/* ===== Переключатель качества ===== */
.vhpp-quality { position: relative; }
.vhpp-quality-btn.vhpp-btn { font-size: 12px; font-weight: 600; min-width: 40px; border-radius: 4px; }
.vhpp-quality-menu {
    position: absolute;
    bottom: 44px;
    right: 0;
    min-width: 130px;
    padding: 6px 0;
    background: rgba(28,28,28,0.96);
    border: 1px solid #3f3f3f;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    display: none;
    z-index: 300;
}
.vhpp-quality.open .vhpp-quality-menu { display: block; }
.vhpp-quality-menu button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: #eee;
    padding: 8px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.vhpp-quality-menu button:hover { background: rgba(255,255,255,0.12); }
.vhpp-quality-menu button.vhpp-active { color: #3ea6ff; font-weight: 600; }

/* ===== Реклама ===== */
.vhpp-ad-tag { display: none; align-items: center; gap: 10px; margin-right: 8px; }
.vhp-player-wrapper.vhpp-ad-mode .vhpp-ad-tag { display: flex; }
.vhpp-ad-label {
    background: #ffc400;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 3px;
    white-space: nowrap;
}
.vhpp-ad-countdown { font-size: 13px; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vhpp-ad-skip {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 9px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 6px;
}
.vhpp-ad-skip svg { width: 14px; height: 14px; flex: 0 0 auto; }
.vhp-player-wrapper.vhpp-ad-mode .vhpp-ad-skip { display: inline-flex; }
.vhpp-ad-skip:disabled { opacity: .65; cursor: default; pointer-events: none; }
.vhpp-ad-skip.can-skip,
.vhpp-ad-skip.can-skip .vhpp-skip-text { color: #000 !important; }
.vhpp-ad-skip.can-skip svg { stroke: #000 !important; }
.vhpp-ad-skip.can-skip { background: #fff; color: #000; border-color: #fff; }
.vhp-player-wrapper.vhpp-ad-mode .vhpp-seek-row { visibility: hidden; }
.vhp-player-wrapper.vhpp-ad-mode .vhpp-time { display: none; }
.vhp-player-wrapper.vhpp-ad-mode .vhpp-rew { display: none !important; }
.vhp-player-wrapper.vhpp-ad-mode .vhpp-quality { display: none; }

/* ===== Кнопка Play по центру и подсказки ===== */
.vhpp-big-play {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    margin: auto;
    width: 68px;
    height: 68px;
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 50%;
    color: #fff;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 150;
    transition: transform .15s ease, background .15s ease;
}
.vhpp-big-play:hover { transform: scale(1.08); background: rgba(0,0,0,0.75); }
.vhpp-big-play svg { width: 32px; height: 32px; flex: 0 0 auto; }
.vhp-player-wrapper:not(.vhpp-idle) .vhpp-big-play { display: none; }
.vhp-player-wrapper.vhpp-ad-mode .vhpp-big-play { display: none; }

.vhpp-hint {
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
    pointer-events: none;
    z-index: 160;
}
.vhpp-hint svg { width: 22px; height: 22px; flex: 0 0 auto; vertical-align: middle; }
.vhp-player-wrapper.vhpp-needs-gesture .vhpp-hint { display: flex; }

/* ===== Мобильная адаптация ===== */
@media (max-width: 600px) {
    .vhpp-time { font-size: 11px; }
    .vhpp-btn { min-width: 30px; height: 30px; font-size: 14px; }
    .vhpp-btn svg { width: 16px; height: 16px; }
    .vhpp-rew svg, .vhpp-fwd svg { width: 13px; height: 13px; }
    .vhpp-step-text { font-size: 9px; }
    .vhpp-vol { width: 44px; }
    .vhpp-big-play { width: 56px; height: 56px; }
    .vhpp-big-play svg { width: 26px; height: 26px; }
    .vhp-player-wrapper.vhpp-ad-mode .vhpp-btn-row { flex-wrap: wrap; row-gap: 8px; }
    .vhp-player-wrapper.vhpp-ad-mode .vhpp-ad-tag { margin-right: 0; }
    .vhp-player-wrapper.vhpp-ad-mode .vhpp-ad-countdown { font-size: 12px; }
    .vhp-player-wrapper.vhpp-ad-mode .vhpp-ad-skip { flex: 1 1 auto; margin-left: 0; text-align: center; }
    .vhp-player-wrapper.vhpp-ad-mode .vhpp-bar { padding-bottom: 6px; }
}

.vhpp-loader{position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;width:68px;height:68px;display:none;align-items:center;justify-content:center;pointer-events:none;z-index:155}
.vhpp-loader.vhpp-loader-active{display:flex}
.vhpp-spinner{width:48px;height:48px;border:4px solid rgba(255,255,255,.25);border-top-color:#fff;border-radius:50%;animation:vhpp-spin .8s linear infinite;box-shadow:0 2px 8px rgba(0,0,0,.4)}
@keyframes vhpp-spin{to{transform:rotate(360deg)}}

.vhp-player-wrapper{position:relative!important;}
.vhpp-loader{position:absolute!important;top:0!important;left:0!important;right:0!important;bottom:0!important;margin:auto!important;width:76px!important;height:76px!important;display:none!important;align-items:center!important;justify-content:center!important;pointer-events:none!important;z-index:2147483647!important;background:rgba(0,0,0,.3)!important;border-radius:50%!important;}
.vhpp-loader.vhpp-loader-active{display:flex!important;}
.vhpp-spinner{width:56px!important;height:56px!important;border:6px solid rgba(255,255,255,.25)!important;border-top-color:#fff!important;border-radius:50%!important;animation:vhpp-spin .8s linear infinite!important;box-shadow:0 4px 12px rgba(0,0,0,.6)!important;}
@keyframes vhpp-spin{to{transform:rotate(360deg)}}
