/* ============================================================
   KivoPlay — Ultra-Premium Custom Video Player v3.0
   Netflix × Prime × Cinema Level Design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ─── PAGE WRAPPER ─────────────────────────────────────────── */
.player-page-wrapper {
    background: #000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── THEATER WRAPPER ──────────────────────────────────────── */
.theater-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.theater-wrapper.theater-mode {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
}

/* ─── VIDEO CONTAINER ──────────────────────────────────────── */
.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    overflow: hidden;
    cursor: none;
}
.video-container.cursor-visible { cursor: default; }

.video-container video,
.video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Fullscreen */
.video-container:fullscreen,
.sv-yt-chrome:fullscreen,
.video-container:-webkit-full-screen,
.sv-yt-chrome:-webkit-full-screen {
    padding-top: 0;
    width: 100%;
    height: 100%;
}
.video-container:fullscreen video,
.video-container:-webkit-full-screen video { width:100%; height:100%; }

/* ─── CINEMATIC AMBIENT GLOW ────────────────────────────────── */
.ambient-glow {
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse, rgba(229,9,20,0.8) 0%, rgba(139,0,20,0.4) 40%, transparent 70%);
    animation: ambientPulse 5s ease-in-out infinite;
    transition: opacity 0.5s ease;
}
.video-container:hover .ambient-glow { opacity: 0.22; }
@keyframes ambientPulse {
    0%,100% { opacity: 0.08; transform: scale(1);    }
    50%      { opacity: 0.18; transform: scale(1.08); }
}

/* ─── SEEK FLASH ANIMATION ──────────────────────────────────── */
.seek-flash {
    position: absolute;
    top: 0; bottom: 0;
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.15s ease;
    font-size: 2rem;
    color: rgba(255,255,255,0.9);
}
.seek-flash.left  { left: 0; background: radial-gradient(ellipse at left, rgba(255,255,255,0.08), transparent); }
.seek-flash.right { right:0; background: radial-gradient(ellipse at right, rgba(255,255,255,0.08), transparent); }
.seek-flash.show  { opacity: 1; animation: seekFlashAnim 0.6s ease forwards; }
@keyframes seekFlashAnim {
    0%   { opacity: 1; }
    60%  { opacity: 1; }
    100% { opacity: 0; }
}
.seek-flash-ripple {
    position: absolute;
    width: 80px; height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    animation: rippleOut 0.6s ease forwards;
}
@keyframes rippleOut {
    0%   { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* ─── KEYBOARD SHORTCUT TOAST ───────────────────────────────── */
.sv-shortcut-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: rgba(0,0,0,0.75);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 14px 24px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    z-index: 30;
    opacity: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: none;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05);
}
.sv-shortcut-toast.show {
    animation: toastPop 1.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes toastPop {
    0%   { opacity:0; transform: translate(-50%,-50%) scale(0.7);  }
    15%  { opacity:1; transform: translate(-50%,-50%) scale(1.05); }
    25%  { opacity:1; transform: translate(-50%,-50%) scale(1);    }
    70%  { opacity:1; transform: translate(-50%,-50%) scale(1);    }
    100% { opacity:0; transform: translate(-50%,-50%) scale(0.9);  }
}

/* ─── LOADING SCREEN ────────────────────────────────────────── */
.sv-loading-screen {
    position: absolute;
    inset: 0;
    z-index: 25;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.6s ease;
}
.sv-loading-screen.hidden { opacity: 0; pointer-events: none; }
.sv-loader-logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    opacity: 0.9;
}
.sv-loader-logo span { color: #e50914; }
.sv-loader-ring {
    width: 56px; height: 56px;
    position: relative;
}
.sv-loader-ring::before,
.sv-loader-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}
.sv-loader-ring::before {
    border-top-color: #e50914;
    animation: spin 0.9s linear infinite;
}
.sv-loader-ring::after {
    border-top-color: rgba(229,9,20,0.25);
    animation: spin 0.9s linear infinite reverse;
    inset: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sv-loader-text {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
}

/* ─── TOP CONTROLS BAR ──────────────────────────────────────── */
.controls-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: calc(20px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px)) 60px calc(24px + env(safe-area-inset-left, 0px));
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 10;
    pointer-events: none;
}
.video-container:hover .controls-top,
.video-container.controls-visible .controls-top {
    opacity: 1;
    pointer-events: all;
}

.player-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0,0,0,0.8);
    letter-spacing: 0.1px;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Back button in top bar */
.sv-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(0,0,0,0.35);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px;
    padding: 7px 16px;
    transition: all 0.25s ease;
}
.sv-back-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    transform: translateX(-2px);
}

/* ─── SKIP INTRO BUTTON ─────────────────────────────────────── */
.skip-intro-btn {
    padding: 10px 22px;
    border: 1.5px solid rgba(255,255,255,0.8);
    border-radius: 6px;
    background: rgba(0,0,0,0.6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    display: none;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}
.skip-intro-btn.visible { display: inline-flex; }
.skip-intro-btn:hover {
    background: rgba(229,9,20,0.9);
    border-color: transparent;
    transform: scale(1.04);
    box-shadow: 0 4px 20px rgba(229,9,20,0.5);
}

/* ─── MAIN CONTROLS OVERLAY ─────────────────────────────────── */
.player-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 80px calc(20px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(20px + env(safe-area-inset-left, 0px));
    background: linear-gradient(to top,
        rgba(0,0,0,0.97) 0%,
        rgba(0,0,0,0.7)  40%,
        rgba(0,0,0,0.2)  75%,
        transparent      100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 10;
    pointer-events: none;
}
.video-container:hover .player-controls,
.video-container.controls-visible .player-controls {
    opacity: 1;
    pointer-events: all;
}
.video-container.controls-always .player-controls { opacity:1; pointer-events: all; }

/* ─── PROGRESS BAR — ULTRA PREMIUM ─────────────────────────── */
.progress-container {
    margin-bottom: 10px;
    position: relative;
    cursor: pointer;
    padding: 8px 0 4px;
    -webkit-user-select: none;
    user-select: none;
}

.progress-track {
    height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 99px;
    position: relative;
    transition: height 0.22s cubic-bezier(0.4,0,0.2,1);
    overflow: visible;
}
.progress-container:hover .progress-track { height: 7px; }

.progress-buffered {
    position: absolute;
    left: 0; top: 0; height: 100%;
    background: rgba(255,255,255,0.22);
    border-radius: 99px;
    pointer-events: none;
    transition: width 0.3s ease;
}

.progress-filled {
    position: absolute;
    left: 0; top: 0; height: 100%;
    background: linear-gradient(90deg, #c80011, #e50914, #ff3040);
    border-radius: 99px;
    pointer-events: none;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(229,9,20,0.5), 0 0 4px rgba(229,9,20,0.8);
}

.progress-thumb {
    position: absolute;
    top: 50%; transform: translateY(-50%) scale(0);
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    box-shadow:
        0 0 0 3px rgba(229,9,20,0.5),
        0 0 16px rgba(255,255,255,0.6),
        0 2px 8px rgba(0,0,0,0.6);
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s;
    opacity: 0;
    margin-left: -8px;
    z-index: 2;
}
.progress-container:hover .progress-thumb {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* Hover time preview tooltip */
.progress-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    transform: translateX(-50%);
    background: rgba(10,10,10,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    display: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.7);
    z-index: 5;
}
.progress-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(10,10,10,0.95);
}
.progress-container:hover .progress-tooltip { display: block; }

/* ─── BOTTOM CONTROLS ROW ───────────────────────────────────── */
.controls-bottom {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── CONTROL BUTTONS ───────────────────────────────────────── */
.ctrl-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.88);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: color 0.18s, transform 0.2s cubic-bezier(0.34,1.56,0.64,1), background 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    position: relative;
    outline: none;
}
.ctrl-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
    transform: scale(1.15);
}
.ctrl-btn:active { transform: scale(0.92); }

/* Tooltip on ctrl buttons */
.ctrl-btn[title]::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10,10,10,0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s 0.3s;
    z-index: 50;
}
.ctrl-btn[title]:hover::after { opacity: 1; }

/* ─── TIME DISPLAY ──────────────────────────────────────────── */
.time-display {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.88);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
    margin: 0 6px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* ─── VOLUME CONTROL ────────────────────────────────────────── */
.volume-control {
    display: flex;
    align-items: center;
    gap: 4px;
}
.volume-slider {
    width: 0;
    height: 4px;
    border-radius: 99px;
    background: rgba(255,255,255,0.2);
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.volume-control:hover .volume-slider { width: 72px; }
.volume-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, #fff, rgba(255,255,255,0.8));
    border-radius: 99px;
    pointer-events: none;
    transition: width 0.1s ease;
}

/* ─── SPACER ────────────────────────────────────────────────── */
.ctrl-spacer { flex: 1; }

/* ─── SPEED BUTTON ──────────────────────────────────────────── */
.speed-btn {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    padding: 5px 10px !important;
    border: 1.5px solid rgba(255,255,255,0.2) !important;
    border-radius: 6px !important;
    min-width: auto !important;
    letter-spacing: 0.8px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease !important;
}
.speed-btn:hover {
    border-color: rgba(255,255,255,0.5) !important;
    background: rgba(255,255,255,0.1) !important;
}

/* ─── SETTINGS MENU ────────────────────────────────────────────── */
.settings-menu {
    position: absolute;
    bottom: 70px;
    right: 60px;
    background: rgba(12,12,12,0.97);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 12px 10px;
    min-width: 180px;
    display: none;
    z-index: 20;
    box-shadow: 0 16px 50px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.04);
}
.settings-menu.visible { display: block; animation: menuSlideUp 0.2s cubic-bezier(0.34,1.56,0.64,1) forwards; }
@keyframes menuSlideUp {
    from { opacity:0; transform: translateY(8px) scale(0.95); }
    to   { opacity:1; transform: translateY(0)   scale(1);    }
}
.settings-menu-item {
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    color: rgba(255,255,255,0.8);
    display: flex; align-items: center; justify-content: space-between;
    transition: all 0.15s ease;
}
.settings-menu-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.settings-menu-item i { margin-right: 8px; width: 16px; text-align: center; }

/* Submenu panels */
.settings-panel { display: none; }
.settings-panel.active { display: block; animation: panelFade 0.2s ease; }
@keyframes panelFade { from{opacity:0;transform:translateX(5px)} to{opacity:1;transform:translateX(0)} }

.settings-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.9rem; font-weight: 700; color: #fff;
    padding: 6px 10px 14px; margin-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer; transition: color 0.15s;
}
.settings-header:hover { color: #e50914; }

.speed-opt, .quality-opt {
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    color: rgba(255,255,255,0.8);
    transition: all 0.15s ease;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.speed-opt:hover, .quality-opt:hover { background: rgba(229,9,20,0.2); color: #fff; }
.speed-opt.active, .quality-opt.active {
    color: #e50914;
    font-weight: 700;
    background: rgba(229,9,20,0.1);
}
.speed-opt.active::after, .quality-opt.active::after { content: '✓'; font-size: 0.75rem; }

/* ─── LOCK SCREEN BUTTON ───────────────────────────────────── */
.lock-btn-float {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 48px; height: 48px;
    display: none;
    align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem;
    z-index: 50; cursor: pointer; transition: all 0.3s ease;
}
.lock-btn-float:hover { background: rgba(255,255,255,0.2); transform: translateX(-50%) scale(1.1); }
.lock-btn-float.visible { display: flex; animation: inflatePop 0.3s; }
@keyframes inflatePop { from{ transform: translateX(-50%) scale(0.5); opacity:0;} to{ transform: translateX(-50%) scale(1); opacity:1;} }

/* Locked State overrides */
.theater-wrapper.is-locked .controls-top,
.theater-wrapper.is-locked .player-controls,
.theater-wrapper.is-locked .big-play-btn,
.theater-wrapper.is-locked .ambient-glow {
    display: none !important; opacity: 0 !important; pointer-events: none !important;
}

/* ─── BIG PLAY / PAUSE BUTTON (center) ─────────────────────── */
.big-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 84px; height: 84px;
    border-radius: 50%;
    background: radial-gradient(circle at center, var(--red) 0%, #c80011 100%);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 3px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
    box-shadow: 0 0 0 0 rgba(229,9,20,0.4), 0 20px 50px rgba(0,0,0,0.6), 0 0 80px rgba(229,9,20,0.3);
    pointer-events: none;
}
.big-play-btn.interactive { pointer-events: all; }
.big-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 0 12px rgba(229,9,20,0.1), 0 25px 60px rgba(0,0,0,0.8);
    background: #ff1f2b;
}
.big-play-btn:active { transform: translate(-50%, -50%) scale(0.95); }
.big-play-btn.hidden { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(0.7); }

/* Animate on pause/play */
.big-play-btn.bounce-anim {
    animation: playBounce 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes playBounce {
    0%   { transform: translate(-50%,-50%) scale(0.7); opacity: 0; }
    60%  { transform: translate(-50%,-50%) scale(1.05); opacity: 1; }
    100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
}

/* ─── LOADING SPINNER ───────────────────────────────────────── */
.player-spinner {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 8;
    display: none;
}
.player-spinner.visible { display: block; }
.spinner-ring {
    width: 52px; height: 52px;
    border: 3px solid rgba(255,255,255,0.08);
    border-top-color: #e50914;
    border-right-color: rgba(229,9,20,0.4);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

/* ─── NEXT EPISODE OVERLAY ──────────────────────────────────── */
.next-episode-overlay {
    position: absolute;
    bottom: 100px;
    right: 28px;
    background: rgba(10,10,10,0.8);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 24px;
    width: 320px;
    display: none;
    z-index: 20;
    box-shadow: 0 24px 80px rgba(0,0,0,1);
}
.next-episode-overlay.visible { display: block; animation: slideInRight 0.35s cubic-bezier(0.34,1.3,0.64,1); }
@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.next-ep-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-weight: 700;
}
.next-ep-title { font-size: 0.92rem; font-weight: 700; margin-bottom: 12px; }
.next-ep-countdown { font-size: 0.78rem; color: rgba(255,255,255,0.55); margin-bottom: 10px; }
.next-ep-progress {
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 14px;
}
.next-ep-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c80011, #e50914);
    border-radius: 99px;
    transition: width 1s linear;
    box-shadow: 0 0 8px rgba(229,9,20,0.6);
}
.next-ep-actions { display: flex; gap: 8px; }
.next-ep-actions button {
    flex: 1; padding: 9px 12px;
    border: none; border-radius: 8px;
    font-size: 0.82rem; font-weight: 700;
    cursor: pointer;
    transition: all 0.22s ease;
    font-family: 'Inter', sans-serif;
}
.btn-play-now {
    background: linear-gradient(135deg, #e50914, #c80011);
    color: #fff;
    box-shadow: 0 4px 16px rgba(229,9,20,0.4);
}
.btn-play-now:hover {
    background: linear-gradient(135deg, #ff1f2b, #e50914);
    transform: scale(1.04);
}
.btn-cancel-next { background: rgba(255,255,255,0.1); color: #fff; }
.btn-cancel-next:hover { background: rgba(255,255,255,0.18); }

/* ─── BELOW PLAYER INFO BAR ────────────────────────────────── */
.player-info-bar {
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: #050505;
    position: relative;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.player-info-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 50%; right: 50%;
    transform: translateX(-50%);
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
    box-shadow: 0 0 20px rgba(229,9,20,0.5);
}
.player-info-title {
    font-size: 1.4rem;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #bbb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.player-info-meta {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.player-info-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── YOUTUBE CHROME (Top Bar + Controls) ───────────────────── */
.sv-yt-chrome { cursor: default; }
.sv-yt-topbar {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px 60px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.88), transparent);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.sv-yt-topbar.sv-ctrl-visible,
.sv-yt-controls.sv-ctrl-visible { opacity: 1 !important; pointer-events: all; }
.sv-yt-controls { opacity: 0; transition: opacity 0.35s ease; }

/* Block YouTube watermark */
#ytInnerPlayer iframe { border: none; pointer-events: none; }

/* ─── MOBILE RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
    .ctrl-btn { font-size: 0.95rem; padding: 7px; min-width: 34px; }
    .ctrl-btn[title]::after { display: none; } /* no tooltips on mobile */
    .time-display { font-size: 0.72rem; margin: 0 4px; }
    .volume-control:hover .volume-slider { width: 52px; }
    .player-info-bar { flex-direction: column; align-items: flex-start; padding: 14px 18px; }
    .next-episode-overlay { 
        width: 230px; 
        right: calc(12px + env(safe-area-inset-right, 0px)); 
        bottom: calc(100px + env(safe-area-inset-bottom, 0px)); 
    }
    .big-play-btn { width: 62px; height: 62px; font-size: 1.3rem; }
    .settings-menu { 
        right: calc(8px + env(safe-area-inset-right, 0px)); 
        bottom: calc(64px + env(safe-area-inset-bottom, 0px)); 
    }
    .sv-shortcut-toast { font-size: 0.88rem; padding: 12px 18px; }
}
@media (max-width: 480px) {
    .player-title { font-size: 0.82rem; }
    .skip-intro-btn { padding: 8px 14px; font-size: 0.8rem; }
    .controls-bottom { gap: 2px; }
    #svRewind, #svForward { display: none; } /* replaced by double-tap */
}
@media (max-height: 500px) and (orientation: landscape) {
    /* Safe areas specifically for landscape mode on phones */
    .settings-menu {
        bottom: calc(50px + env(safe-area-inset-bottom, 0px));
        max-height: 80vh;
        overflow-y: auto;
    }
    .next-episode-overlay {
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        padding: 16px;
    }
    .player-controls {
        padding-top: 60px;
    }
}
