/* DRAMABOS - Mobile Styles (DramaBox-like) */

@media (max-width: 768px) {
    .custom-subtitle {
        bottom: 80px;
        font-size: 15px;
    }

    /* Hide desktop nav */
    .navbar {
        display: none;
    }

    main {
        padding-top: 0;
        padding-bottom: 0;
    }

    /* Source Selector Mobile */
    .source-selector {
        position: sticky;
        top: 0;
        z-index: 96;
        padding: 0.6rem 1rem;
        background: rgba(13, 13, 13, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-color);
    }

    .source-pill {
        padding: 6px 14px;
        font-size: 12px;
    }

    .pill-icon {
        width: 16px;
        height: 16px;
    }

    /* ========== MOBILE SEARCH BAR ========== */
    .mobile-search-bar {
        display: block;
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 0.75rem 1rem;
        background: rgba(13, 13, 13, 0.95);
        backdrop-filter: blur(10px);
    }

    .mobile-search-container {
        position: relative;
        display: flex;
        align-items: center;
    }

    .mobile-search-icon {
        position: absolute;
        left: 0.75rem;
        width: 18px;
        height: 18px;
        color: var(--text-muted);
    }

    .mobile-search-input {
        width: 100%;
        padding: 0.65rem 1rem 0.65rem 2.5rem;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 100px;
        color: var(--text-primary);
        font-family: 'Outfit', sans-serif;
        font-size: 0.9rem;
    }

    .mobile-search-input::placeholder {
        color: var(--text-muted);
    }

    .mobile-search-input:focus {
        outline: none;
        border-color: var(--accent-primary);
    }

    .mobile-search-results {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-radius: 12px;
        margin-top: 0.5rem;
        max-height: 300px;
        overflow-y: auto;
        z-index: 101;
        display: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .mobile-search-results.active {
        display: block;
    }

    .mobile-search-results .search-result-item {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        cursor: pointer;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-search-results .search-result-item:last-child {
        border-bottom: none;
    }

    .mobile-search-results .search-result-item:active {
        background: var(--bg-tertiary);
    }

    .mobile-search-results .search-result-item img {
        width: 45px;
        height: 60px;
        object-fit: cover;
        border-radius: 6px;
    }

    .mobile-search-results .search-result-info h4 {
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text-primary);
    }

    /* ========== VIDEO CONTROLS OVERLAY (DramaBox Style) ========== */
    .video-controls-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.8) 100%);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 20;
        pointer-events: none;
    }

    .video-controls-overlay.visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Top Controls */
    .controls-top {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        padding-top: max(0.75rem, env(safe-area-inset-top));
        background: transparent;
        pointer-events: auto;
    }

    .controls-back {
        background: rgba(0, 0, 0, 0.5);
        border: none;
        color: #fff;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(10px);
        transition: all 0.2s ease;
    }

    .controls-back:active {
        transform: scale(0.95);
        background: rgba(0, 0, 0, 0.7);
    }

    .controls-title {
        flex: 1;
        color: #fff;
        font-size: 0.9rem;
        font-weight: 600;
        margin-left: 0.75rem;
        text-shadow: 0 2px 4px rgba(0,0,0,0.5);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .controls-top-right {
        display: flex;
        gap: 0.75rem;
    }

    .controls-btn {
        background: rgba(0, 0, 0, 0.5);
        border: none;
        color: #fff;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(10px);
        transition: all 0.2s ease;
    }

    .controls-btn:active {
        transform: scale(0.95);
        background: rgba(0, 0, 0, 0.7);
    }

    /* Center Controls */
    .controls-center {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        pointer-events: auto;
    }

    .controls-play {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: rgba(255,255,255,0.25);
        border: 2px solid rgba(255,255,255,0.3);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .controls-play:active {
        transform: scale(0.9);
        background: rgba(255,255,255,0.35);
    }

    .controls-play svg {
        width: 28px;
        height: 28px;
    }

    .controls-seek {
        display: flex;
        flex-direction: column;
        align-items: center;
        background: rgba(0, 0, 0, 0.5);
        border: none;
        color: #fff;
        cursor: pointer;
        opacity: 0.9;
        padding: 0.5rem;
        border-radius: 12px;
        backdrop-filter: blur(10px);
        transition: all 0.2s ease;
        gap: 0.25rem;
    }

    .controls-seek:active {
        transform: scale(0.95);
        opacity: 1;
        background: rgba(0, 0, 0, 0.7);
    }

    .controls-seek svg {
        width: 24px;
        height: 24px;
    }

    .controls-seek span {
        font-size: 0.65rem;
        font-weight: 600;
        margin-top: 0;
    }

    /* Bottom Controls */
    .controls-bottom {
        padding: 0.75rem 1rem;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
        background: transparent;
        pointer-events: auto;
    }

    .controls-time {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        font-size: 0.75rem;
        color: #fff;
        margin-bottom: 0.5rem;
        font-weight: 500;
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }

    .controls-progress {
        position: relative;
        width: 100%;
        height: 24px;
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem;
    }

    .controls-progress input[type="range"] {
        width: 100%;
        height: 4px;
        -webkit-appearance: none;
        appearance: none;
        background: rgba(255,255,255,0.25);
        border-radius: 2px;
        cursor: pointer;
        position: relative;
        z-index: 2;
        outline: none;
    }

    .controls-progress input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 16px;
        height: 16px;
        background: #fff;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        transition: transform 0.2s ease;
    }

    .controls-progress input[type="range"]::-webkit-slider-thumb:active {
        transform: scale(1.2);
    }

    .controls-progress input[type="range"]::-moz-range-thumb {
        width: 16px;
        height: 16px;
        background: #fff;
        border-radius: 50%;
        cursor: pointer;
        border: none;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .progress-filled {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        height: 4px;
        background: #fff;
        border-radius: 2px;
        pointer-events: none;
        z-index: 1;
        transition: width 0.1s linear;
    }

    .controls-bottom-actions {
        display: flex;
        justify-content: flex-end;
        margin-top: 0.75rem;
    }

    .controls-bottom-actions .controls-btn {
        background: rgba(0, 0, 0, 0.5);
        border-radius: 20px;
        width: auto;
        height: auto;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        font-size: 0.75rem;
        font-weight: 500;
    }

    .controls-bottom-actions .controls-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Swipe indicator */
    .swipe-hint {
        position: absolute;
        bottom: 120px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        color: rgba(255,255,255,0.7);
        font-size: 0.7rem;
        animation: bounce 2s infinite;
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 5;
        background: rgba(0, 0, 0, 0.5);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        backdrop-filter: blur(10px);
    }

    .swipe-hint.visible {
        opacity: 1;
        visibility: visible;
    }

    .swipe-hint svg {
        width: 20px;
        height: 20px;
        margin-bottom: 4px;
    }

    @keyframes bounce {
        0%, 100% { transform: translateX(-50%) translateY(0); }
        50% { transform: translateX(-50%) translateY(-8px); }
    }

    /* ========== HOME MOBILE ========== */
    .home-page .hero {
        min-height: 320px;
        padding: 1.25rem;
        position: relative;
    }

    .home-page .hero-content {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .home-page .hero-poster {
        display: none;
    }

    .home-page .hero-bg {
        opacity: 0.4;
    }
    
    .home-page .hero-bg::after {
        background: linear-gradient(180deg, transparent 20%, rgba(13,13,13,0.8) 60%, rgba(13,13,13,1) 100%);
    }

    .home-page .hero-info {
        padding-top: 100px;
    }

    .home-page .hero-title {
        font-size: 1.6rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }

    .home-page .hero-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        margin-bottom: 0.5rem;
    }
    
    .home-page .hero-meta {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .home-page .hero-badge {
        font-size: 0.55rem;
        padding: 0.3rem 0.6rem;
        margin-bottom: 0.5rem;
    }

    .home-page .hero-actions {
        flex-direction: row;
    }

    .home-page .btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.8rem;
    }

    .section {
        padding: 1.25rem 1rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .drama-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .drama-info {
        padding: 0.5rem;
    }

    .drama-title {
        font-size: 0.75rem;
    }

    .drama-meta {
        font-size: 0.65rem;
    }

    /* Load More Button Mobile */
    .load-more-btn {
        padding: 0.75rem 2rem;
        font-size: 0.85rem;
    }
    
    .load-more-container {
        margin-top: 1.5rem;
        padding: 0.5rem 0 1rem;
    }

    /* ========== DETAIL MOBILE ========== */
    .detail-page .detail-hero {
        padding: 0;
        position: relative;
    }

    .detail-page .detail-bg {
        height: 260px;
        opacity: 0.5;
    }

    .detail-page .detail-bg::after {
        background: linear-gradient(180deg, transparent 30%, rgba(13,13,13,0.9) 70%, rgba(13,13,13,1) 100%);
    }

    .detail-page .detail-content {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0;
    }

    .detail-page .detail-poster {
        display: none;
    }

    .detail-page .detail-info {
        padding: 0 1rem;
        padding-top: 180px;
        position: relative;
    }

    .detail-page .detail-info .back-btn {
        position: fixed;
        top: 0.75rem;
        left: 0.75rem;
        background: rgba(0,0,0,0.6);
        padding: 0.5rem;
        border-radius: 50%;
        z-index: 100;
        backdrop-filter: blur(4px);
    }

    .detail-page .detail-info h1,
    .detail-page .detail-info h1.detail-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        margin-top: 0;
        line-height: 1.2;
        display: block;
        color: var(--text-primary);
        font-family: 'Playfair Display', serif;
        font-weight: 700;
    }

    .detail-page .detail-tags {
        margin-bottom: 0.5rem;
    }
    
    .detail-page .detail-tag {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    .detail-page .detail-stats {
        margin-bottom: 0.75rem;
    }
    
    .detail-page .detail-stat-value {
        font-size: 1.1rem;
    }
    
    .detail-page .detail-stat-label {
        font-size: 0.6rem;
    }

    .detail-page .detail-synopsis {
        font-size: 0.8rem;
        -webkit-line-clamp: 4;
        line-clamp: 4;
        margin-bottom: 1rem;
    }

    .detail-page .hero-actions {
        flex-direction: column;
    }

    .detail-page .hero-actions .btn {
        width: 100%;
        padding: 0.85rem;
        font-size: 0.9rem;
    }

    /* Episodes Mobile */
    .episodes-section {
        padding: 1rem;
    }
    

    .episodes-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.4rem;
    }
    
    /* Responsive episode grid for smaller screens */
    @media (max-width: 360px) {
        .episodes-grid {
            grid-template-columns: repeat(5, 1fr);
            gap: 0.35rem;
        }
        
        .episode-sheet-grid {
            grid-template-columns: repeat(5, 1fr);
        }
    }

    .episode-btn {
        font-size: 0.8rem;
        border-radius: 10px;
        padding: 0.6rem 0.3rem;
        min-height: 42px;
        font-weight: 700;
        background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
        border: 2px solid var(--border-color);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        -webkit-tap-highlight-color: transparent;
    }
    
    .episode-btn.active {
        background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
        box-shadow: 0 4px 12px rgba(230, 184, 84, 0.4);
        transform: translateZ(0) scale(1.02);
    }
    
    .episode-btn:active:not(.active) {
        transform: translateZ(0) scale(0.98);
        opacity: 0.8;
    }

    /* ========== PLAYER MOBILE - DRAMABOX STYLE ========== */
    /* Hide desktop player */
    .player-page .player-container {
        display: none;
    }
    
    /* Show mobile player */
    .player-page .mobile-player {
        display: block;
    }

    .player-page.active {
        position: fixed;
        inset: 0;
        z-index: 2000;
        background: #000;
        overflow: hidden;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        touch-action: none;
    }

    /* Prevent body scroll when player is active */
    body.player-active {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
        touch-action: none !important;
        -webkit-overflow-scrolling: none !important;
    }
    
    html.player-active {
        overflow: hidden !important;
        height: 100% !important;
    }

    /* Mobile Player - Fullscreen Portrait Video */
    .mobile-player {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .mobile-video-container {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        background: #000;
        touch-action: none; /* Completely prevent scroll on video container */
        overflow: hidden;
        -webkit-overflow-scrolling: none;
        overscroll-behavior: none;
        -webkit-overscroll-behavior: none;
    }

    .mobile-video-container video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        -webkit-playsinline: true;
        background: #000;
        will-change: contents;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    /* Video Overlay - Shows on pause */
    .video-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    .video-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    /* Top Bar */
    .overlay-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    }

    .overlay-back {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: #fff;
        background: none;
        border: none;
        font-size: 0.9rem;
        font-family: 'Outfit', sans-serif;
        cursor: pointer;
    }

    .overlay-ep {
        font-size: 0.9rem;
        font-weight: 600;
    }

    .overlay-actions {
        display: flex;
        gap: 1rem;
    }

    .overlay-actions button {
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
        padding: 0.25rem;
    }

    /* Center Play Button */
    .overlay-center {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .play-pause-btn {
        width: 70px;
        height: 70px;
        border-radius: 50%;
        background: rgba(255,255,255,0.2);
        border: none;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .play-pause-btn:active {
        transform: scale(0.95);
    }

    /* ========== EPISODE SHEET (Slide up from bottom) ========== */
    .episode-sheet {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-radius: 20px 20px 0 0;
        padding: 1rem;
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
        max-height: 65%;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        z-index: 30;
        display: flex;
        flex-direction: column;
        touch-action: pan-y;
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    }

    .episode-sheet.visible {
        transform: translateY(0);
    }

    .episode-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .episode-sheet-header h3 {
        font-size: 1rem;
        font-weight: 600;
    }

    .sheet-close {
        background: var(--bg-tertiary);
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

    .sheet-close:active {
        transform: scale(0.95);
        background: var(--bg-card);
    }

    .episode-sheet-speed {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
        flex-shrink: 0;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-color);
    }

    .speed-label {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--text-secondary);
        margin-bottom: 0.25rem;
    }

    .speed-buttons {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .speed-btn {
        padding: 0.5rem 1rem;
        background: var(--bg-tertiary);
        border: 1.5px solid var(--border-color);
        border-radius: 8px;
        color: var(--text-primary);
        cursor: pointer;
        font-family: 'Outfit', sans-serif;
        font-size: 0.8rem;
        font-weight: 600;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .speed-btn.active {
        background: var(--accent-primary);
        color: #0d0d0d;
        border-color: var(--accent-primary);
    }

    .speed-btn:active {
        transform: scale(0.95);
    }

    .episode-sheet-quality {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
        flex-shrink: 0;
    }

    .episode-sheet-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0.6rem;
        overflow-y: auto;
        overflow-x: hidden;
        flex: 1;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-right: 0.5rem;
        padding-bottom: 0.5rem;
        scroll-behavior: smooth;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        scroll-padding: 0.5rem;
        /* Ensure smooth scrolling */
        will-change: scroll-position;
    }
    
    /* Prevent episode sheet from interfering with video swipe */
    .episode-sheet.visible ~ .mobile-video-container {
        touch-action: none;
    }
    
    /* Ensure episode sheet scrolls smoothly */
    .episode-sheet-grid::-webkit-scrollbar {
        width: 6px;
    }
    
    .episode-sheet-grid::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 3px;
    }
    
    .episode-sheet-grid::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }
    
    .episode-sheet-grid::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }

    .episode-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .episode-sheet-header h3 {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-primary);
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        padding-right: 0.5rem;
    }

    /* Episode buttons in sheet - Only Number - IMPROVED DESIGN */
    .overlay-episode-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
        border: 2px solid var(--border-color);
        border-radius: 10px;
        color: #fff;
        cursor: pointer;
        font-family: 'Outfit', sans-serif;
        position: relative;
        text-align: center;
        padding: 0.7rem 0.3rem;
        min-height: 48px;
        transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
        font-size: 0.85rem;
        font-weight: 700;
        aspect-ratio: 1;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .overlay-episode-btn::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
        opacity: 0;
        transition: opacity 0.2s ease;
        z-index: 0;
    }

    .overlay-episode-btn.active {
        background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
        color: #0d0d0d;
        border-color: var(--accent-primary);
        font-weight: 800;
        box-shadow: 0 4px 12px rgba(230, 184, 84, 0.4);
        transform: translateZ(0) scale(1.02);
    }

    .overlay-episode-btn.active::before {
        opacity: 1;
    }

    .overlay-episode-btn:active:not(.active) {
        transform: translateZ(0) scale(0.98);
        opacity: 0.8;
    }

    .overlay-episode-btn.playing::after {
        content: '';
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        width: 12px;
        height: 3px;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='4' y='4' width='4' height='16'/%3E%3Crect x='10' y='8' width='4' height='8'/%3E%3Crect x='16' y='6' width='4' height='12'/%3E%3C/svg%3E") center/contain no-repeat;
    }

    /* Episode that has stream available */
    .overlay-episode-btn.available {
        border-color: var(--accent-secondary);
        background: rgba(230, 184, 84, 0.15);
    }

    /* Episode not yet loaded - still clickable */
    .overlay-episode-btn:not(.available):not(.active) {
        opacity: 0.7;
    }
    
    .overlay-episode-btn:not(.available):not(.active):hover,
    .overlay-episode-btn:not(.available):not(.active):active {
        opacity: 1;
        background: var(--accent-primary);
        color: #0d0d0d;
    }

    /* Quality selector mobile */
    .mobile-quality-selector {
        display: flex;
        gap: 0.4rem;
        padding: 0.5rem 0;
        overflow-x: auto;
        margin-bottom: 0.5rem;
    }

    .mobile-quality-btn {
        padding: 0.35rem 0.65rem;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        color: var(--text-secondary);
        cursor: pointer;
        font-family: 'Outfit', sans-serif;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .mobile-quality-btn.active {
        background: var(--accent-primary);
        color: #0d0d0d;
        border-color: var(--accent-primary);
    }
}

