* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    max-width: 100vw;
    box-sizing: border-box;
}
body {
    background-color: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 10px;
    box-sizing: border-box;
}
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    .custom-video-player {
        max-height: calc(100vh - 10px);
        min-height: 200px;
        width: 100%;
        max-width: 100vw;
    }
    .custom-video-player[style*="min-height: 400px"] {
        min-height: 200px !important;
    }
    .custom-video-player video {
        max-height: calc(100vh - 10px);
        width: 100%;
        height: auto;
        max-width: 100%;
    }
}
/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .custom-video-player {
        max-height: calc(100vh - 10px);
        min-height: 180px;
    }
    .custom-video-player video {
        max-height: calc(100vh - 10px);
    }
}
.custom-video-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    max-height: calc(100vh - 20px);
    min-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
.custom-video-player video {
    width: 100%;
    height: auto;
    display: block;
    max-height: calc(100vh - 20px);
    object-fit: contain;
    max-width: 100%;
    box-sizing: border-box;
}
/* Logo Control */
.logo-control {
    display: flex;
    align-items: center;
    margin-right: 8px;
}
.logo-control img {
    height: 28px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.2s;
}
.logo-control:hover img {
    opacity: 1;
}
@media (max-width: 768px) {
    .logo-control {
        margin-right: 2px;
    }
    .logo-control img {
        height: 18px;
        max-width: 80px;
    }
}
@media (max-width: 480px) {
    .logo-control {
        margin-right: 1px;
    }
    .logo-control img {
        height: 14px;
        max-width: 60px;
    }
}
/* Large Centered Play Button Overlay */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: #f90;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.4);
}
.play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.play-overlay:hover {
    background: #ff9900;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 153, 0, 0.6);
}
.play-overlay:active {
    transform: translate(-50%, -50%) scale(0.95);
}
.play-overlay svg {
    width: 40px;
    height: 40px;
    fill: #fff;
    margin-left: 4px;
}
.custom-video-player.playing .play-overlay {
    opacity: 0;
    pointer-events: none;
}
@media (max-width: 768px) {
    .play-overlay {
        width: 70px;
        height: 70px;
    }
    .play-overlay svg {
        width: 35px;
        height: 35px;
    }
}
@media (max-width: 480px) {
    .play-overlay {
        width: 60px;
        height: 60px;
    }
    .play-overlay svg {
        width: 30px;
        height: 30px;
    }
}
/* Custom Video Player Controls - Monestream Style */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    padding: 15px 10px 10px;
    opacity: 0;
    transition: opacity 0.3s;
    touch-action: none;
}
.custom-video-player:hover .custom-controls,
.custom-video-player.controls-visible .custom-controls,
.custom-video-player.touching .custom-controls {
    opacity: 1;
}
.progress-container {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.2);
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 3px;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}
.progress-bar {
    height: 100%;
    background: #f90;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s;
}
.progress-scrubber {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    pointer-events: none;
}
.progress-container:hover .progress-scrubber,
.progress-container.dragging .progress-scrubber {
    display: block;
}
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.control-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color 0.2s;
    min-width: 36px;
    height: 36px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.control-btn:hover {
    color: #f90;
}
.control-btn:active {
    transform: scale(0.95);
}
.control-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    pointer-events: none;
}
.control-btn span {
    font-size: 11px;
}
.time-display {
    color: #fff;
    font-size: 14px;
    font-family: monospace;
    white-space: nowrap;
    margin: 0 5px;
    user-select: none;
}
.volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
}
.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}
.volume-fill {
    height: 100%;
    background: #f90;
    border-radius: 2px;
    width: 100%;
}
.speed-menu {
    position: relative;
}
.speed-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 14px;
    min-width: 50px;
}
.speed-options {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #1c1c1c;
    border: 1px solid #434645;
    border-radius: 6px;
    padding: 5px 0;
    margin-bottom: 5px;
    display: none;
    min-width: 80px;
    z-index: 100;
}
.speed-options.show {
    display: block;
}
.speed-option {
    padding: 8px 15px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.speed-option:hover {
    background: #434645;
}
.speed-option.active {
    color: #f90;
    background: #434645;
}
@media (max-width: 768px) {
    .custom-controls {
        padding: 8px 6px 6px;
    }
    .controls-row {
        flex-wrap: wrap;
        gap: 4px;
    }
    .controls-left {
        gap: 2px;
        flex-wrap: wrap;
    }
    .controls-right {
        gap: 2px;
    }
    .control-btn {
        min-width: 32px;
        height: 32px;
        padding: 4px;
    }
    .control-btn svg {
        width: 14px;
        height: 14px;
    }
    .control-btn span {
        font-size: 9px;
    }
    .volume-slider {
        width: 40px;
        height: 4px;
    }
    .time-display {
        font-size: 10px;
        margin: 0 2px;
    }
    .speed-btn {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 38px;
    }
    .speed-options {
        min-width: 60px;
        font-size: 11px;
    }
    .speed-option {
        padding: 5px 10px;
        font-size: 11px;
    }
    .progress-container {
        height: 6px;
        margin-bottom: 8px;
    }
    .progress-scrubber {
        width: 14px;
        height: 14px;
    }
    /* Banner Ad Content Responsive Styles for Tablets */
    .ad-container.ad-banner .ad-content {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    .ad-container.ad-banner .ad-content img,
    .ad-container.ad-banner .ad-content picture,
    .ad-container.ad-banner .ad-content picture img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block;
        object-fit: contain;
    }
    .ad-container.ad-banner .ad-content iframe {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0;
    }
    .ad-container.ad-banner .ad-content video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain;
    }
    .ad-container.ad-banner .ad-content * {
        max-width: 100% !important;
        box-sizing: border-box;
    }
    .ad-container.ad-banner .ad-content div,
    .ad-container.ad-banner .ad-content span,
    .ad-container.ad-banner .ad-content a {
        max-width: 100% !important;
    }
}
@media (max-width: 480px) {
    body {
        padding: 3px;
    }
    .custom-video-player {
        max-height: calc(100vh - 6px);
        min-height: 150px;
        width: 100%;
        max-width: 100vw;
    }
    .custom-video-player[style*="min-height: 400px"] {
        min-height: 150px !important;
    }
    .custom-video-player video {
        max-height: calc(100vh - 6px);
        width: 100%;
        height: auto;
        max-width: 100%;
    }
    .custom-controls {
        padding: 6px 4px 4px;
    }
    .controls-row {
        gap: 2px;
    }
    .controls-left {
        gap: 1px;
    }
    .controls-right {
        gap: 1px;
    }
    .control-btn {
        min-width: 28px;
        height: 28px;
        padding: 3px;
    }
    .control-btn svg {
        width: 12px;
        height: 12px;
    }
    .control-btn span {
        font-size: 8px;
    }
    .time-display {
        font-size: 9px;
        margin: 0 1px;
    }
    .volume-slider {
        width: 35px;
        height: 3px;
    }
    .speed-btn {
        padding: 3px 6px;
        font-size: 9px;
        min-width: 32px;
    }
    .speed-options {
        min-width: 55px;
        font-size: 10px;
    }
    .speed-option {
        padding: 4px 8px;
        font-size: 10px;
    }
    .progress-container {
        height: 5px;
        margin-bottom: 6px;
    }
    .progress-scrubber {
        width: 12px;
        height: 12px;
    }
    /* Banner Ad Content Responsive Styles for Small Mobile */
    .ad-container.ad-banner .ad-content {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    .ad-container.ad-banner .ad-content img,
    .ad-container.ad-banner .ad-content picture,
    .ad-container.ad-banner .ad-content picture img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block;
        object-fit: contain;
    }
    .ad-container.ad-banner .ad-content iframe {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0;
    }
    .ad-container.ad-banner .ad-content video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain;
    }
    .ad-container.ad-banner .ad-content * {
        max-width: 100% !important;
        box-sizing: border-box;
    }
    .ad-container.ad-banner .ad-content div,
    .ad-container.ad-banner .ad-content span,
    .ad-container.ad-banner .ad-content a {
        max-width: 100% !important;
    }
}
/* Ad Container Styles - All ads are inside the video player container */
.ad-container {
    position: absolute;
    pointer-events: auto;
}

/* Popup Ad Styles - Transparent wrapper, ad code handles its own styling */
.popup-ad {
    position: absolute;
    z-index: 999;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* Roll Ad Styles (pre_roll, mid_roll, post_roll) */
.roll-ad {
    position: absolute;
    z-index: 1000;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* Banner Ad Styles */
.ad-container.ad-banner {
    position: absolute;
    z-index: 100;
    max-width: 100%;
    box-sizing: border-box;
}

/* Banner Ad Content Base Styles - Make content responsive */
.ad-container.ad-banner .ad-content {
    max-width: 100%;
    box-sizing: border-box;
}

.ad-container.ad-banner .ad-content img,
.ad-container.ad-banner .ad-content picture,
.ad-container.ad-banner .ad-content picture img {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.ad-container.ad-banner .ad-content iframe {
    max-width: 100%;
    width: 100%;
    height: auto;
}

.ad-container.ad-banner .ad-content video {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Social Bar Ad Styles */
.ad-container.ad-social_bar {
    position: absolute;
    z-index: 100;
}

.ad-content {
    margin-bottom: 10px;
    position: relative;
}

.ad-link {
    display: inline-block;
}

.ad-link img {
    max-width: 100%;
    height: auto;
}

/* Ensure ads work in fullscreen mode */
.custom-video-player:fullscreen .ad-container,
.custom-video-player:-webkit-full-screen .ad-container,
.custom-video-player:-moz-full-screen .ad-container,
.custom-video-player:-ms-fullscreen .ad-container {
    position: absolute;
}

/* Ensure controls and overlays work in fullscreen */
.custom-video-player:fullscreen .custom-controls,
.custom-video-player:-webkit-full-screen .custom-controls,
.custom-video-player:-moz-full-screen .custom-controls,
.custom-video-player:-ms-fullscreen .custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
}

.custom-video-player:fullscreen .play-overlay,
.custom-video-player:-webkit-full-screen .play-overlay,
.custom-video-player:-moz-full-screen .play-overlay,
.custom-video-player:-ms-fullscreen .play-overlay {
    position: absolute;
    z-index: 10;
}

.custom-video-player:fullscreen .error-404-overlay,
.custom-video-player:-webkit-full-screen .error-404-overlay,
.custom-video-player:-moz-full-screen .error-404-overlay,
.custom-video-player:-ms-fullscreen .error-404-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 50;
}

/* Ensure video player container maintains relative positioning in fullscreen */
.custom-video-player:fullscreen,
.custom-video-player:-webkit-full-screen,
.custom-video-player:-moz-full-screen,
.custom-video-player:-ms-fullscreen {
    position: relative !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
}

.custom-video-player:fullscreen video,
.custom-video-player:-webkit-full-screen video,
.custom-video-player:-moz-full-screen video,
.custom-video-player:-ms-fullscreen video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    box-sizing: border-box;
}

/* 404 Error Overlay */
.error-404-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none;
}

.error-404-content {
    text-align: center;
    color: #fff;
}

.error-404-number {
    font-size: 120px;
    font-weight: 700;
    line-height: 1;
    color: #f90;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(255, 153, 0, 0.5);
}

.error-404-message {
    font-size: 24px;
    font-weight: 500;
    color: #fff;
    opacity: 0.9;
    margin-bottom: 15px;
}

.error-404-submessage {
    font-size: 16px;
    font-weight: 400;
    color: #9ca3af;
    opacity: 0.8;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .error-404-number {
        font-size: 80px;
        margin-bottom: 15px;
    }
    .error-404-message {
        font-size: 18px;
        margin-bottom: 12px;
    }
    .error-404-submessage {
        font-size: 14px;
        max-width: 400px;
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .error-404-number {
        font-size: 60px;
        margin-bottom: 10px;
    }
    .error-404-message {
        font-size: 16px;
        margin-bottom: 10px;
    }
    .error-404-submessage {
        font-size: 12px;
        max-width: 300px;
        padding: 0 15px;
    }
}

