:root {
    --primary-color: #8b5cf6; /* Violet */
    --primary-glow: rgba(139, 92, 246, 0.5);
    --bg-dark: #000;
    --text-white: #fff;
    --glass-bg: rgba(20, 20, 20, 0.7);
    --font-main: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    background-color: #0f0f0f;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: var(--font-main);
    /* player UI clips inside .player-wrapper; body must stay visible so ad overlays/popups work */
    overflow: hidden;
}
/* Ad root sits above everything; never inherit player overflow clipping */
#wpst-ad-root {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    pointer-events: none;
    overflow: visible !important;
}
#wpst-ad-root > * {
    pointer-events: auto;
}

/* --- Container --- */
.player-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
    overflow: hidden;
}

/* --- Video.js Engine Reset --- */
.video-js {
    width: 100% !important;
    height: 100% !important;
}

.video-js .vjs-control-bar,
.video-js .vjs-big-play-button,
.video-js .vjs-loading-spinner,
.video-js .vjs-error-display,
.video-js .vjs-modal-dialog {
    display: none !important; /* Hide Default UI */
}

/* --- Custom UI Overlay --- */
.custom-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* children with pointer-events:auto still work */
    z-index: 10;
    opacity: 1;
    transition: opacity 0.18s ease;
    font-size: 16px !important;
    line-height: normal !important;
}

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

/* Gesture Layer — #custom-ui এর বাইরে (sibling), opacity fade প্রভাব ফেলে না */
.gesture-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* UI লুকানো থাকলে gesture উপরে — ট্যাপ নিশ্চিত */
.player-wrapper.ui-gone .gesture-layer {
    z-index: 50 !important;
    pointer-events: auto !important;
}

/* --- Spinner Layer: independent of .custom-ui opacity fade, always visible --- */
.spinner-layer {
    position: absolute;
    top: 44%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88px;
    height: 88px;
    z-index: 15;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Resume modal open থাকলে spinner পুরোপুরি লুকাও (z-index stacking issue এড়াতে) */
.spinner-layer.resume-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* --- Center Controls --- */
.center-controls {
    position: absolute;
    top: 44%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 60;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-loader-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
}

/* ── Soft blur placeholder (CSS-only, no image/network) ── */
.blur-thumb-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.45s ease;
}

.blur-thumb-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.blur-thumb-bg {
    position: absolute;
    inset: -12%;
    width: 124%;
    height: 124%;
    background-color: #0a0a12;
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(99, 102, 241, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 80% 70%, rgba(168, 85, 247, 0.28) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 90%, rgba(59, 130, 246, 0.22) 0%, transparent 45%),
        radial-gradient(ellipse 50% 35% at 70% 20%, rgba(236, 72, 153, 0.15) 0%, transparent 40%),
        linear-gradient(160deg, #12121a 0%, #0d0d14 40%, #151520 100%);
    filter: blur(28px) saturate(1.15);
    transform: scale(1.12);
    animation: blur-drift 9s ease-in-out infinite alternate;
}

.blur-thumb-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    pointer-events: none;
    mix-blend-mode: overlay;
}

@keyframes blur-drift {
    0%   { transform: scale(1.12) translate(0, 0); }
    100% { transform: scale(1.16) translate(-1.5%, 1%); }
}

body.server-fallback .blur-thumb-bg {
    background-image:
        radial-gradient(ellipse 80% 60% at 25% 35%, rgba(245, 158, 11, 0.32) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 75% 65%, rgba(251, 191, 36, 0.22) 0%, transparent 50%),
        radial-gradient(ellipse 55% 40% at 50% 85%, rgba(217, 119, 6, 0.18) 0%, transparent 45%),
        linear-gradient(160deg, #14120c 0%, #0f0e0a 40%, #1a160f 100%);
}

/* ── Dual-ring Spinner: initial loading (primary = white/red, fallback = amber)
   Size matches .big-play-btn: 72px desktop / 70px mobile ── */
.loader {
    --color-1: #fff;
    --color-2: #ff3d00;
    --size: 1.5px; /* 48*1.5 = 72px — big-play সমান */

    position: absolute;
    z-index: 5;
    width: calc(48 * var(--size));
    height: calc(48 * var(--size));
    border-radius: 50%;
    display: inline-block;
    border-top: calc(4 * var(--size)) solid var(--color-1);
    border-right: calc(4 * var(--size)) solid transparent;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    pointer-events: none;
}
.loader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 0;
    top: 0;
    width: calc(48 * var(--size));
    height: calc(48 * var(--size));
    border-radius: 50%;
    border-bottom: calc(4 * var(--size)) solid var(--color-2);
    border-left: calc(4 * var(--size)) solid transparent;
}
@keyframes rotation {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Buffer/Seek Ring: normal spinner ── */
.buffer-circle {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 64px;
    height: 64px;
    pointer-events: none;
    z-index: 3;
    animation: smooth-spin 0.85s linear infinite;
}

.buffer-track {
    fill: none;
    stroke: rgba(59, 130, 246, 0.25);
    stroke-width: 5;
}

.buffer-arc {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 125.6;
    stroke-dashoffset: 31; /* ~75% arc */
}

/* ── 2nd server indicator: spinner → amber ── */
body.server-fallback .loader {
    --color-1: #fbbf24;
    --color-2: #f59e0b;
}
body.server-fallback .buffer-arc {
    stroke: #f59e0b;
}
body.server-fallback .buffer-track {
    stroke: rgba(245, 158, 11, 0.25);
}

@keyframes smooth-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Big Play Button — gradient + soft breathe + lag-free neon ring
   Neon: transform+opacity only (no animated box-shadow → mobile-friendly) ── */
.big-play-btn {
    position: absolute;
    z-index: 4;
    background: linear-gradient(145deg, #60a5fa 0%, #3b82f6 40%, #1d4ed8 100%) !important;
    background-color: #3b82f6 !important;
    opacity: 1 !important;
    border: none !important;
    outline: none !important;
    border-radius: 50%;
    width: 72px;
    height: 72px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    /* static glow only — animate করি না */
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 16px 3px rgba(59, 130, 246, 0.45);
    animation: soft-breathe 2.8s ease-in-out infinite;
    will-change: transform;
}

.big-play-btn:hover  { animation-play-state: paused; transform: scale(1.08); }
.big-play-btn:active { animation-play-state: paused; transform: scale(0.94); }

/* হালকা breathe — শুধু transform */
@keyframes soft-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* নিয়ন রিং: border + scale/opacity (GPU composite) — box-shadow pulse নয় */
.big-play-btn::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(96, 165, 250, 0.9);
    background: transparent;
    box-shadow: none;
    animation: neon-ring-pulse 2s ease-out infinite;
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity;
}

@keyframes neon-ring-pulse {
    0% {
        transform: scale(1);
        opacity: 0.95;
    }
    70% {
        transform: scale(1.55);
        opacity: 0;
    }
    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

/* ── Secondary server: amber + same lag-free ring ── */
body.server-fallback .big-play-btn:not(.resume-mode) {
    background: linear-gradient(145deg, #fbbf24 0%, #f59e0b 40%, #d97706 100%) !important;
    background-color: #f59e0b !important;
    border: none !important;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 16px 3px rgba(245, 158, 11, 0.45);
    animation: soft-breathe 2.8s ease-in-out infinite;
}
body.server-fallback .big-play-btn:not(.resume-mode)::after {
    content: "";
    display: block;
    border-color: rgba(251, 191, 36, 0.95);
    box-shadow: none;
    animation: neon-ring-pulse 2s ease-out infinite;
}

.big-play-btn svg,
.big-play-btn i {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    margin: 0 !important;
    /* play triangle optical center: হালকা ডানে + হালকা নিচে */
    transform: translate(1.5px, 1px);
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}
/* pause bars geometrically centered — no nudge */
.big-play-btn svg:has(rect) {
    transform: none;
}

/* ── Resume state: মাঝপথে pause করলে (প্রথমবারের CTA নয়) — শান্ত/কম distracting ── */
.big-play-btn.resume-mode {
    animation: none !important;
    background: rgba(20,20,20,0.6) !important;
    background-color: rgba(20,20,20,0.6) !important;
    border: 1.5px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.35) !important;
}

.big-play-btn.resume-mode::after {
    animation: none !important;
    box-shadow: none !important;
    border: none !important;
    opacity: 0 !important;
    will-change: auto;
}

.big-play-btn.resume-mode svg {
    animation: none;
}

/* Pop-in: লোড শেষে appear */
.big-play-btn.pop-in {
    animation: btn-pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}
@keyframes btn-pop-in {
    0%   { transform: scale(0);    opacity: 0; }
    70%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

/* Pop-out: play হওয়া মাত্র disappear */
.big-play-btn.pop-out {
    animation: btn-pop-out 0.35s ease-in forwards !important;
}
@keyframes btn-pop-out {
    0%   { transform: scale(1);   opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.big-play-btn.hidden { display: none !important; }


.hidden { display: none !important; }

/* --- Seek Overlays --- */
.seek-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 15;
    pointer-events: none;
}

.seek-overlay.left { left: 0; border-radius: 0 50% 50% 0; }
.seek-overlay.right { right: 0; border-radius: 50% 0 0 50%; }

.seek-overlay.active { opacity: 1; }

.icon-box {
    background: rgba(0,0,0,0.5);
    padding: 15px;
    border-radius: 50%;
    text-align: center;
    color: white;
}
.icon-box i { display: block; font-size: 24px; margin-bottom: 5px; }
.icon-box span { font-size: 12px; font-weight: 600; }


/* --- Bottom Controls Panel --- */
.bottom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.6) 50%, rgba(0,0,0,0));
    padding: 30px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 20;
    pointer-events: auto;
    transition: transform 0.18s ease;
    will-change: transform;
}

.custom-ui.ui-hidden .bottom-controls {
    transform: translateY(100%);
}

/* Row 1: Progress (now on top) */
.progress-row {
    width: 100%;
    height: 20px;
    display: flex;
    align-items: center;
}

/* Row 2: Time (now below progress bar) */
.time-row {
    font-size: 13px;
    color: #ccc;
    font-weight: 500;
    display: flex;
    gap: 5px;
    user-select: none;
}
.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s;
}

.progress-container:hover { height: 6px; }

/* Progress shimmer — only during initial load / rebuffer / seek (JS toggles .progress-loading) */
.progress-container.progress-loading {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.15) 25%,
        rgba(255,255,255,0.35) 50%,
        rgba(255,255,255,0.15) 75%
    );
    background-size: 200% 100%;
    animation: progressShimmer 1.3s ease-in-out infinite;
}

@keyframes progressShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    border-radius: 2px;
    position: relative;
    z-index: 2;
}

.progress-handle {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.2s;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.progress-container:hover .progress-handle { transform: translateY(-50%) scale(1); }

.buffered-bar {
    height: 100%;
    background: rgba(255,255,255,0.3);
    width: 0%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    border-radius: 2px;
}

/* Row 3: Buttons */
.buttons-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.left-buttons, .right-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 32px !important; /* Optimized Desktop Size */
    width: 45px !important;
    height: 45px !important;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: all 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.control-btn i {
    font-size: 32px !important; /* Optimized Icon Size */
    line-height: 1 !important;
    display: block;
    width: 100%;
    height: auto;
}


.control-btn:hover {
    opacity: 1;
    color: var(--primary-color);
    transform: scale(1.15);
}

/* Mute অবস্থায় ভলিউম আইকন — চোখে আলাদা কালার */
.control-btn.is-muted,
.control-btn.is-muted i {
    color: #f87171 !important; /* soft red */
    opacity: 1 !important;
}
.control-btn.is-muted:hover,
.control-btn.is-muted:hover i {
    color: #ef4444 !important;
}

/* Speed label in control bar (replaces gear icon) */
.control-btn.speed-btn {
    font-size: 14px !important;
    font-weight: 700;
    letter-spacing: 0.3px;
    min-width: 45px;
    width: auto !important;
    padding: 5px 8px;
    font-family: var(--font-main);
}
.control-btn.speed-btn .speed-label {
    font-size: 14px !important;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* Volume */
.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#volume-slider {
    width: 0;
    opacity: 0;
    transition: all 0.3s;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.volume-container:hover #volume-slider {
    width: 60px;
    opacity: 1;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .bottom-controls {
        left: 0;
        right: 0;
        bottom: 0;
        padding: 20px 10px 8px 10px; /* Reduced padding for more space */
    }
    
    .big-play-btn { 
        width: 70px !important; 
        height: 70px !important; 
    }
    .big-play-btn svg {
        width: 28px !important;
        height: 28px !important;
    }
    /* loader/amber = big-play সাইজ (mobile 70px) */
    .loader {
        --size: 1.458px; /* 48*1.458 ≈ 70px */
    }
    
    .volume-container input { display: none; } /* Hide volume slider on mobile */
    
    .control-btn { 
        font-size: 26px !important; /* Optimized Mobile Size */
        width: 40px !important;
        height: 40px !important;
        padding: 0; /* Remove padding to save space */
    }
    
    .control-btn i {
        font-size: 26px !important;
    }

    .control-btn.speed-btn {
        font-size: 13px !important;
        width: auto !important;
        min-width: 36px;
        padding: 0 6px;
    }
    .control-btn.speed-btn .speed-label {
        font-size: 13px !important;
    }

    /* Better spacing for controls */
    .controls-left, .right-buttons {
        gap: 10px;
    }
}

/* --- Settings Menu — horizontal speed chips --- */
.settings-menu {
    position: absolute;
    bottom: 90px;
    right: 12px;
    background: rgba(20, 20, 20, 0.95);
    width: auto;
    min-width: 0;
    max-width: calc(100% - 24px);
    border-radius: 12px;
    overflow: hidden;
    z-index: 30;
    pointer-events: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
}

.settings-header span {
    font-weight: 600;
    font-size: 13px;
    color: white;
}

.close-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    display: flex;
}
.close-btn:hover { color: white; }

/* Horizontal row: 0.5x — 0.75x — 1x — … */
.speed-options {
    list-style: none;
    padding: 8px 10px;
    margin: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.speed-options::-webkit-scrollbar { display: none; }

.speed-options li {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #ddd;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.speed-options li:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.speed-options li.active {
    color: #fff;
    font-weight: 700;
    background: rgba(139, 92, 246, 0.35);
}

/* Checkmark বাদ — active chip background দিয়েই বোঝা যায় */
.speed-options li.active::after {
    content: none;
}

/* Mobile Adjustments for Settings */
@media (max-width: 768px), (max-height: 450px) {
    .settings-menu {
        bottom: 58px;
        right: 8px;
        left: auto;
        transform: none;
        width: auto;
        max-width: calc(100% - 16px);
        background: rgba(20, 20, 20, 0.88);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .settings-header {
        padding: 6px 10px;
    }

    .speed-options {
        padding: 6px 8px;
        gap: 2px;
    }
    
    .speed-options li {
        padding: 5px 8px;
        font-size: 11px;
    }
}

/* --- Resume Modal --- */
.resume-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6); /* Darker overlay */
    backdrop-filter: blur(5px); /* Blur background behind modal */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 65; /* .center-controls (60) এর উপরে — যাতে play বাটন popup এর উপর না ভাসে */
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.resume-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.resume-content {
    background: rgba(30, 30, 30, 0.65); /* Glassy Background */
    backdrop-filter: blur(15px); /* Strong blur for premium feel */
    -webkit-backdrop-filter: blur(15px);
    padding: 28px 30px 28px; /* top ≈ bottom — title-এর উপরের স্পেস = বাটনের নিচের স্পেস */
    border-radius: 20px;
    text-align: center;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.1); /* Glow & Depth */
    border: 1px solid rgba(255,255,255,0.15); /* Subtle border */
}

.resume-content h3 {
    margin: 0 0 8px 0;
    color: white;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.resume-content p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.resume-actions {
    display: flex;
    gap: 25px;
    justify-content: center;
    margin: 0; /* no extra push down — buttons sit higher, bottom space matches top */
}

.resume-btn {
    position: relative;
    padding: 10px 24px;
    border-radius: 50px; /* Pill shape for premium look */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: var(--font-main);
    letter-spacing: 0.5px;
    min-width: 7.5em; /* টেক্সট→স্পিনার এলে বাটন চওড়া না কাঁপে */
    min-height: 2.6em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.resume-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), #7c3aed);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.resume-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.5);
    filter: brightness(1.1);
}

.resume-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: #eee;
    backdrop-filter: blur(5px);
}

.resume-btn.secondary:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: white;
    transform: translateY(-2px);
}

/* ক্লিকের পর: টেক্সট হাইড + ছোট স্পিনার */
.resume-btn.is-loading {
    color: transparent !important;
    pointer-events: none;
    cursor: default;
    transform: none !important;
    filter: none !important;
}
.resume-btn.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    box-sizing: border-box;
    animation: resume-btn-spin 0.65s linear infinite;
}
.resume-btn.secondary.is-loading::after {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.9);
}
.resume-btn.primary.is-loading::after {
    border-color: rgba(255, 255, 255, 0.28);
    border-top-color: #fff;
}
@keyframes resume-btn-spin {
    to { transform: rotate(360deg); }
}
.resume-btn:disabled {
    opacity: 0.85;
    cursor: default;
}

/* Mobile & Small Screen Adjustments for Resume Modal */
@media (max-width: 768px), (max-height: 450px) {
    .resume-content {
        padding: 20px 15px 20px; /* balanced top/bottom */
        width: 85%;
        max-width: 300px;
        border-radius: 12px;
    }
    
    .resume-content h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .resume-content p {
        font-size: 13px;
        margin-bottom: 14px;
    }
    
    .resume-btn {
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    .resume-actions {
        gap: 20px;
        margin: 0;
    }
}

/* Landscape / সাধারণ — ফ্রেম ভর্তি */
.video-js {
    position: relative !important;
    overflow: hidden !important;
}

video,
.video-js video,
.video-js .vjs-tech,
.video-js.vjs-fullscreen:not(.portrait) video,
.video-js.vjs-fullscreen:not(.portrait) .vjs-tech,
.player-wrapper:fullscreen:not(.is-portrait) video,
.player-wrapper:-webkit-full-screen:not(.is-portrait) video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    margin: 0 !important;
}

/* Portrait ছোট মোড — cover */
.video-js.portrait:not(.vjs-fullscreen) video,
.video-js.portrait:not(.vjs-fullscreen) .vjs-tech {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* Portrait ফুলস্ক্রিন — ফোন portrait থাকলে */
.player-wrapper.is-portrait:fullscreen,
.player-wrapper.is-portrait:-webkit-full-screen {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #000 !important;
}
.player-wrapper.is-portrait:fullscreen:not(.fs-force-portrait) video,
.player-wrapper.is-portrait:-webkit-full-screen:not(.fs-force-portrait) video,
.video-js.portrait.vjs-fullscreen video,
.video-js.portrait.vjs-fullscreen .vjs-tech {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto !important;
}

/* Portrait ভিডিও + ফোন landscape → ৯০° ঘুরিয়ে স্ক্রিন ভর্তি */
.player-wrapper.is-portrait.fs-force-portrait:fullscreen,
.player-wrapper.is-portrait.fs-force-portrait:-webkit-full-screen {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 100vh !important;
    height: 100vw !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    display: block !important;
    background: #000 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}
.player-wrapper.is-portrait.fs-force-portrait:fullscreen .video-js,
.player-wrapper.is-portrait.fs-force-portrait:-webkit-full-screen .video-js {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    inset: 0 !important;
}
.player-wrapper.is-portrait.fs-force-portrait:fullscreen video,
.player-wrapper.is-portrait.fs-force-portrait:-webkit-full-screen video,
.player-wrapper.is-portrait.fs-force-portrait:fullscreen .vjs-tech,
.player-wrapper.is-portrait.fs-force-portrait:-webkit-full-screen .vjs-tech {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    margin: 0 !important;
    transform: none !important;
}
.player-wrapper.is-portrait.fs-force-portrait:fullscreen .custom-ui,
.player-wrapper.is-portrait.fs-force-portrait:-webkit-full-screen .custom-ui,
.player-wrapper.is-portrait.fs-force-portrait:fullscreen .gesture-layer,
.player-wrapper.is-portrait.fs-force-portrait:-webkit-full-screen .gesture-layer {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
/* --- Broken Video Error Screen --- */
.error-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: auto;
    overflow: hidden;
}

.error-screen.hidden {
    display: none !important;
}

.error-content {
    text-align: center;
    padding: clamp(10px, 3%, 30px) clamp(8px, 4%, 20px);
    max-width: min(360px, 95%);
    width: 95%;
    box-sizing: border-box;
}

.error-icon {
    font-size: clamp(24px, 6vw, 56px);
    color: #ef4444;
    margin-bottom: clamp(6px, 2%, 16px);
    line-height: 1;
}

.error-content h2 {
    color: #fff;
    font-size: clamp(13px, 3.5vw, 20px);
    font-weight: 700;
    margin: 0 0 clamp(4px, 1.5%, 10px) 0;
}

.error-content p {
    color: rgba(255, 255, 255, 0.65);
    font-size: clamp(10px, 2.5vw, 13px);
    line-height: 1.5;
    margin: 0 0 clamp(8px, 2%, 24px) 0;
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-btn {
    padding: clamp(6px, 1.5%, 10px) clamp(12px, 3%, 22px);
    border-radius: 50px;
    font-size: clamp(10px, 2.5vw, 13px);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-main);
    transition: all 0.25s ease;
}

.error-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #eee;
}

.error-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.error-btn.primary {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

.error-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
}

@media (max-width: 400px) {
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
}
