/**
 * Scoped clone of frontend/explode.html reel + desktop styles.
 * All rules live under #cartoons-explode-root (no global body/header overrides).
 */
#cartoons-explode-root {
    --reels-height: 100vh;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

@supports (height: 100svh) {
    #cartoons-explode-root {
        --reels-height: 100svh;
    }
}

@supports (height: 100dvh) {
    #cartoons-explode-root {
        --reels-height: 100dvh;
    }
}

@keyframes ce-shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes ce-pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.95);
        opacity: 1;
    }
}

@keyframes ce-fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ce-slideInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ce-float-gentle {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

#cartoons-explode-root .ce-reel-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    background: #000;
}

#cartoons-explode-root .mobile-reels-container {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: var(--reels-height);
    max-height: var(--reels-height);
    -webkit-overflow-scrolling: touch;
    background: radial-gradient(1000px 600px at 20% 10%, rgba(107, 151, 196, 0.18) 0%, transparent 55%),
        radial-gradient(900px 600px at 90% 80%, rgba(142, 179, 214, 0.18) 0%, transparent 55%),
        #0a0e14;
    position: relative;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
}

#cartoons-explode-root .mobile-reels-container::-webkit-scrollbar {
    display: none;
}

#cartoons-explode-root .mobile-reels-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#cartoons-explode-root .reel-slide {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: var(--reels-height);
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

#cartoons-explode-root .video-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

#cartoons-explode-root .video-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0.05) 100%);
}

#cartoons-explode-root .video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1rem calc(2.8rem + var(--safe-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    color: white;
    z-index: 10;
    pointer-events: none;
}

/* Action rail — inner edge of video (inline-end), vertically centered */
#cartoons-explode-root .action-sidebar,
#cartoons-explode-root .ce-modal-actions,
body.page-cartoons-explode #desktopPlayerModal .ce-modal-actions {
    position: absolute;
    inset-inline-end: max(0.75rem, var(--safe-right, 0px));
    top: 50%;
    bottom: auto;
    left: auto;
    right: auto;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    z-index: 35;
    max-height: min(78vh, calc(100% - 2rem));
    overflow-x: visible;
    overflow-y: auto;
    padding: 0.25rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
    pointer-events: auto;
}

#cartoons-explode-root .ce-action-group,
body.page-cartoons-explode #desktopPlayerModal .ce-action-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

#cartoons-explode-root .action-btn,
body.page-cartoons-explode #desktopPlayerModal .action-btn {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

#cartoons-explode-root .action-btn:hover:not(:disabled),
body.page-cartoons-explode #desktopPlayerModal .action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}

#cartoons-explode-root .action-sidebar .action-btn:hover:not(:disabled),
#cartoons-explode-root .ce-modal-actions .action-btn:hover:not(:disabled),
body.page-cartoons-explode #desktopPlayerModal .ce-modal-actions .action-btn:hover:not(:disabled) {
    transform: none;
}

#cartoons-explode-root .action-btn:disabled,
body.page-cartoons-explode #desktopPlayerModal .action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#cartoons-explode-root .action-btn.ce-audio-on,
body.page-cartoons-explode #desktopPlayerModal .action-btn.ce-audio-on {
    background: rgba(107, 151, 196, 0.55);
    border-color: rgba(255, 255, 255, 0.45);
}

#cartoons-explode-root .action-btn.ce-quiz-on,
body.page-cartoons-explode #desktopPlayerModal .action-btn.ce-quiz-on {
    background: rgba(107, 151, 196, 0.55);
    border-color: rgba(255, 255, 255, 0.45);
}

#cartoons-explode-root .action-count {
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
}

#cartoons-explode-root .progress-bar-bg,
body.page-cartoons-explode #desktopPlayerModal .progress-bar-bg {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

#cartoons-explode-root .progress-fill,
body.page-cartoons-explode #desktopPlayerModal .progress-fill {
    position: relative;
    height: 100%;
    background: linear-gradient(90deg, #6b97c4 0%, #bcd1e8 50%, #8eb3d6 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

#cartoons-explode-root .progress-fill::after,
body.page-cartoons-explode #desktopPlayerModal .progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: ce-shimmer 2s linear infinite;
}

#cartoons-explode-root .desktop-layout {
    display: none;
}

#cartoons-explode-root .mobile-only {
    display: block;
}

/* Desktop player modal — fixed to viewport (teleported to body) */
@media (min-width: 768px) {
    body.page-cartoons-explode #desktopPlayerModal,
    #cartoons-explode-root #desktopPlayerModal {
        position: fixed;
        inset: 0;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        margin: 0;
        padding: 2rem;
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: none;
        box-sizing: border-box;
        background: rgba(8, 12, 22, 0.55);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.4s;
    }

    body.page-cartoons-explode #desktopPlayerModal.active,
    #cartoons-explode-root #desktopPlayerModal.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.page-cartoons-explode #desktopPlayerModal .modal-content,
    #cartoons-explode-root #desktopPlayerModal .modal-content {
        position: relative;
        margin: auto;
        flex-shrink: 0;
        max-width: min(1200px, 100%);
        width: 100%;
        height: min(82vh, calc(100vh - 4rem));
        max-height: calc(100vh - 4rem);
        display: flex;
        flex-direction: row;
        overflow: hidden;
        background: rgba(10, 18, 32, 0.45);
        backdrop-filter: blur(18px) saturate(1.1);
        -webkit-backdrop-filter: blur(18px) saturate(1.1);
        border-radius: 48px;
        box-shadow: 0 60px 120px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
        border: 1.5px solid rgba(255, 255, 255, 0.18);
        animation: ce-slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    body.page-cartoons-explode #desktopPlayerModal .modal-video-pane,
    #cartoons-explode-root #desktopPlayerModal .modal-video-pane {
        flex: 2 1 0%;
        min-width: 0;
        background: #000;
        position: relative;
        min-height: 200px;
        overflow: hidden;
    }

    body.page-cartoons-explode #desktopPlayerModal .modal-video-pane .video-overlay,
    #cartoons-explode-root #desktopPlayerModal .modal-video-pane .video-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem 1rem 1.5rem;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, transparent 100%);
        color: #fff;
        z-index: 15;
        pointer-events: none;
    }

    body.page-cartoons-explode #desktopPlayerModal .ce-modal-player-root,
    #cartoons-explode-root #desktopPlayerModal .ce-modal-player-root {
        position: relative;
        display: block;
        height: 100%;
        width: 100%;
        overflow: visible;
    }

    body.page-cartoons-explode #desktopPlayerModal .ce-modal-player-root .ce-stream-video,
    body.page-cartoons-explode #desktopPlayerModal .ce-modal-player-root video,
    #cartoons-explode-root #desktopPlayerModal .ce-modal-player-root .ce-stream-video,
    #cartoons-explode-root #desktopPlayerModal .ce-modal-player-root video {
        overflow: hidden;
    }

    body.page-cartoons-explode #desktopPlayerModal .modal-info-pane,
    #cartoons-explode-root #desktopPlayerModal .modal-info-pane {
        flex: 1 1 0%;
        min-width: 0;
        background: rgba(15, 23, 42, 0.26);
        backdrop-filter: blur(24px) saturate(1.15);
        -webkit-backdrop-filter: blur(24px) saturate(1.15);
        border-inline-start: 1px solid rgba(255, 255, 255, 0.14);
        padding: 2rem;
        color: white;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    body.page-cartoons-explode #desktopPlayerModal .modal-close,
    #cartoons-explode-root #desktopPlayerModal .modal-close {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 10001;
        background: linear-gradient(135deg, rgba(107, 151, 196, 0.95) 0%, rgba(77, 122, 171, 0.95) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 50px;
        padding: 10px 20px;
        color: white;
        border: 2px solid rgba(255, 255, 255, 0.55);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-weight: 800;
        font-size: 0.9rem;
        min-width: 0;
        min-height: 0;
        box-shadow: 0 12px 28px rgba(107, 151, 196, 0.45), 0 0 0 3px rgba(255, 255, 255, 0.18);
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    body.page-cartoons-explode #desktopPlayerModal .modal-close:hover,
    #cartoons-explode-root #desktopPlayerModal .modal-close:hover {
        transform: translateY(-1px) scale(1.04);
        box-shadow: 0 16px 34px rgba(107, 151, 196, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.22);
    }

    html[dir="rtl"] body.page-cartoons-explode #desktopPlayerModal .modal-close,
    html[dir="rtl"] #cartoons-explode-root #desktopPlayerModal .modal-close {
        right: auto;
        left: 20px;
    }

    body.page-cartoons-explode #desktopPlayerModal .ce-modal-player-root,
    #cartoons-explode-root #desktopPlayerModal .ce-modal-player-root {
        min-height: 100%;
        min-width: 100%;
        height: 100%;
        width: 100%;
    }

    body.page-cartoons-explode #desktopPlayerModal .ce-modal-player-root video.ce-stream-video,
    #cartoons-explode-root #desktopPlayerModal .ce-modal-player-root video.ce-stream-video {
        z-index: 1;
    }

    body.page-cartoons-explode #desktopPlayerModal .modal-info-pane .ce-modal-quiz-card,
    #cartoons-explode-root #desktopPlayerModal .modal-info-pane .ce-modal-quiz-card {
        flex-shrink: 0;
    }

    body.page-cartoons-explode #desktopPlayerModal .modal-info-pane .ce-modal-watch-hint,
    #cartoons-explode-root #desktopPlayerModal .modal-info-pane .ce-modal-watch-hint {
        flex-shrink: 0;
    }

    body.page-cartoons-explode #desktopPlayerModal .modal-info-pane .quiz-option,
    #cartoons-explode-root #desktopPlayerModal .modal-info-pane .quiz-option {
        background: rgba(255, 255, 255, 0.08);
        border: 1.5px solid rgba(255, 255, 255, 0.2);
        border-radius: 60px;
        padding: 12px 10px;
        margin-top: 10px;
        font-weight: 700;
        font-size: 0.95rem;
        cursor: pointer;
        width: 100%;
        color: #fff;
        text-align: center;
    }

    body.page-cartoons-explode #desktopPlayerModal .ce-text-primary,
    #cartoons-explode-root #desktopPlayerModal .ce-text-primary {
        color: #6b97c4;
    }
}

@media (max-width: 767px) {
    body.page-cartoons-explode #desktopPlayerModal,
    #cartoons-explode-root #desktopPlayerModal {
        display: none !important;
    }
}

@media (min-width: 768px) {
    #cartoons-explode-root .mobile-only {
        display: none !important;
    }

    #cartoons-explode-root .desktop-layout {
        display: block;
    }

    #cartoons-explode-root .category-pill {
        background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
        border-radius: 40px;
        padding: 12px 28px;
        font-weight: 700;
        font-size: 0.9rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
        border: 1.5px solid #e8ecf0;
        color: #475569;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    #cartoons-explode-root .category-pill:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
        border-color: #d1d5db;
    }

    #cartoons-explode-root .category-pill.active {
        background: linear-gradient(135deg, #6b97c4 0%, #8eb3d6 100%);
        color: white;
        border-color: transparent;
        box-shadow: 0 12px 32px rgba(107, 151, 196, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3),
            0 0 0 3px rgba(107, 151, 196, 0.15);
        transform: translateY(-2px) scale(1.05);
    }

    #cartoons-explode-root .video-card {
        border-radius: 32px;
        overflow: hidden;
        background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%);
        box-shadow: 0 15px 40px -12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
        cursor: pointer;
        transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        border: 1.5px solid rgba(0, 0, 0, 0.05);
        opacity: 0;
        animation: ce-fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }

    #cartoons-explode-root .video-card:nth-child(1) {
        animation-delay: 0.1s;
    }
    #cartoons-explode-root .video-card:nth-child(2) {
        animation-delay: 0.2s;
    }
    #cartoons-explode-root .video-card:nth-child(3) {
        animation-delay: 0.3s;
    }
    #cartoons-explode-root .video-card:nth-child(4) {
        animation-delay: 0.4s;
    }

    #cartoons-explode-root .video-card:hover {
        box-shadow: 0 28px 60px -15px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(107, 151, 196, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 1);
        border-color: rgba(107, 151, 196, 0.2);
    }

    #cartoons-explode-root .video-card .img-wrapper {
        position: relative;
        aspect-ratio: 9 / 16;
        overflow: hidden;
    }

    #cartoons-explode-root .video-card .ce-card-grad {
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 55%, transparent);
        pointer-events: none;
        z-index: 3;
    }

    #cartoons-explode-root .video-card .ce-card-play-wrap {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        z-index: 6;
    }

    #cartoons-explode-root .video-card .ce-card-play-wrap .play-circle {
        pointer-events: auto;
        cursor: pointer;
    }

    /* Desktop grid cards: no like/bookmark rail (use modal + header); reels keep action-sidebar */
    #cartoons-explode-root .video-card .ce-card-actions {
        display: none !important;
    }

    #cartoons-explode-root .video-card .img-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
        background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
    }

    #cartoons-explode-root .video-card:hover .img-wrapper img {
        transform: scale(1.05);
    }

    #cartoons-explode-root .play-circle {
        width: 64px;
        height: 64px;
        background: linear-gradient(135deg, rgba(107, 151, 196, 0.95) 0%, rgba(77, 122, 171, 0.9) 100%);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        box-shadow: 0 8px 24px rgba(107, 151, 196, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
        border: 2px solid rgba(255, 255, 255, 0.3);
        position: relative;
        color: white;
    }

    #cartoons-explode-root .play-circle::before {
        content: "";
        position: absolute;
        inset: -4px;
        border-radius: 50%;
        border: 2px solid rgba(107, 151, 196, 0.4);
        animation: ce-pulse-ring 2s ease-in-out infinite;
    }

    #cartoons-explode-root .video-card:hover .play-circle {
        transform: scale(1.2);
        box-shadow: 0 12px 36px rgba(107, 151, 196, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }

    #cartoons-explode-root .desktop-player-modal {
        position: fixed;
        inset: 0;
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        z-index: 200;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.4s;
        padding: 2rem;
    }

    #cartoons-explode-root .desktop-player-modal.active {
        opacity: 1;
        visibility: visible;
    }

    #cartoons-explode-root .modal-content {
        background: rgba(10, 18, 32, 0.45);
        backdrop-filter: blur(18px) saturate(1.1);
        -webkit-backdrop-filter: blur(18px) saturate(1.1);
        border-radius: 48px;
        max-width: 1200px;
        width: 100%;
        height: 82vh;
        display: flex;
        overflow: hidden;
        box-shadow: 0 60px 120px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
        border: 1.5px solid rgba(255, 255, 255, 0.18);
        animation: ce-slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    #cartoons-explode-root .modal-video-pane {
        flex: 2;
        background: #000;
        position: relative;
        min-height: 200px;
    }

    #cartoons-explode-root .modal-video-pane .video-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem 1rem 1.5rem;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, transparent 100%);
        color: #fff;
        z-index: 15;
        pointer-events: none;
    }

    #cartoons-explode-root .modal-info-pane {
        flex: 1;
        background: rgba(15, 23, 42, 0.26);
        backdrop-filter: blur(24px) saturate(1.15);
        -webkit-backdrop-filter: blur(24px) saturate(1.15);
        border-inline-start: 1px solid rgba(255, 255, 255, 0.14);
        padding: 2rem;
        color: white;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    #cartoons-explode-root .modal-close {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 650;
        background: linear-gradient(135deg, rgba(107, 151, 196, 0.95) 0%, rgba(77, 122, 171, 0.95) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 50px;
        padding: 10px 20px;
        color: white;
        border: 2px solid rgba(255, 255, 255, 0.55);
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 800;
        font-size: 0.9rem;
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        box-shadow: 0 12px 28px rgba(107, 151, 196, 0.45), 0 0 0 3px rgba(255, 255, 255, 0.18);
    }

    html[dir="rtl"] #cartoons-explode-root .modal-close {
        right: auto;
        left: 20px;
    }

    #cartoons-explode-root .modal-close:hover {
        transform: translateY(-1px) scale(1.04);
        box-shadow: 0 16px 34px rgba(107, 151, 196, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.22);
    }
}

@media (max-width: 767px) {
    #cartoons-explode-root .video-overlay {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
    }

    #cartoons-explode-root .action-btn {
        background: rgba(255, 255, 255, 0.16);
        border-color: rgba(255, 255, 255, 0.28);
        width: 48px;
        height: 48px;
    }

    #cartoons-explode-root .action-sidebar {
        gap: 0.45rem;
        max-height: min(70vh, calc(100% - 5rem));
    }

    #cartoons-explode-root .action-sidebar .ce-secondary-action {
        display: none !important;
    }

    #cartoons-explode-root .action-sidebar.ce-expanded .ce-secondary-action {
        display: flex !important;
    }

    #cartoons-explode-root .action-sidebar.ce-expanded .action-btn.ce-secondary-action {
        display: flex !important;
    }

    #cartoons-explode-root .desktop-player-modal,
    #cartoons-explode-root .modal-close {
        display: none !important;
    }
}

#cartoons-explode-root .home-link {
    position: fixed;
    top: calc(16px + var(--safe-top));
    right: calc(16px + var(--safe-right));
    z-index: 50;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 60px;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

html[dir="rtl"] #cartoons-explode-root .home-link {
    right: auto;
    left: calc(16px + var(--safe-left));
}

#cartoons-explode-root .ce-scroll-hint {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    bottom: calc(0.5rem + var(--safe-bottom));
    color: white;
    font-size: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    max-width: calc(100vw - 2rem);
    white-space: nowrap;
    font-weight: 600;
}

#cartoons-explode-root .ce-scroll-hint i {
    animation: ce-float-gentle 2s ease-in-out infinite;
}

#cartoons-explode-root .ce-reel-grad {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.12) 45%, transparent 100%);
}

#cartoons-explode-root .video-card .ce-badge-corner {
    position: absolute;
    top: 0.75rem;
    inset-inline-end: 0.75rem;
}

#cartoons-explode-root .ce-badge-pre {
    background-color: #8eb3d6;
    color: #fff;
}
#cartoons-explode-root .ce-badge-a1 {
    background-color: #6b97c4;
    color: #fff;
}
#cartoons-explode-root .ce-badge-a2 {
    background-color: #6b97c4;
    color: #fff;
}
#cartoons-explode-root .ce-badge-b1 {
    background-color: #4d7aab;
    color: #fff;
}

#cartoons-explode-root .ce-badge-pill {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 800;
}

html.ce-modal-open,
body.ce-modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

#cartoons-explode-root .video-overlay .ce-reel-title {
    font-size: 1.5rem;
    font-weight: 900;
    margin-top: 0.5rem;
    line-height: 1.25;
}

#cartoons-explode-root .video-overlay .ce-reel-desc {
    font-size: 0.875rem;
    opacity: 0.88;
    margin-top: 0.25rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#cartoons-explode-root .ce-text-primary {
    color: #6b97c4;
}

@media (min-width: 768px) and (max-width: 1023px) {
    #cartoons-explode-root .category-pill {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    #cartoons-explode-root .video-card {
        border-radius: 24px;
    }

    #cartoons-explode-root .modal-content,
    body.page-cartoons-explode #desktopPlayerModal .modal-content {
        max-width: 95%;
        height: 75vh;
        border-radius: 36px;
    }
}

/* -------------------------------------------------------------------------- */
/* Cartoons /explode page — mobile fullscreen reels (mirrors frontend/explode.html) */
/* -------------------------------------------------------------------------- */

@media (max-width: 767px) {
    html:has(body.page-cartoons-explode) {
        height: 100%;
        overflow: hidden;
    }

    body.page-cartoons-explode {
        --reels-height: 100vh;
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }

    @supports (height: 100dvh) {
        body.page-cartoons-explode {
            --reels-height: 100dvh;
            height: 100dvh;
            max-height: 100dvh;
        }
    }

    body.page-cartoons-explode .site-header,
    body.page-cartoons-explode .mobile-drawer-overlay,
    body.page-cartoons-explode .mobile-navigation,
    body.page-cartoons-explode .site-footer,
    body.page-cartoons-explode .back-to-top {
        display: none !important;
    }

    body.page-cartoons-explode #cartoons-explode-root {
        position: relative;
        width: 100vw;
        height: var(--reels-height);
        min-height: var(--reels-height);
        max-height: var(--reels-height);
        overflow: hidden;
        margin: 0;
        padding: 0;
    }

    body.page-cartoons-explode #cartoons-explode-root #ceMain:not(.hidden) {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    body.page-cartoons-explode #cartoons-explode-root .mobile-only {
        flex: 1;
        min-height: 0;
        width: 100vw;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
    }

    body.page-cartoons-explode #cartoons-explode-root .mobile-reels-container {
        flex: 1 1 auto;
        min-height: 0;
        width: 100vw;
        height: 100%;
        max-height: none;
    }

    body.page-cartoons-explode #cartoons-explode-root .reel-slide {
        width: 100vw;
        height: 100%;
        min-height: 100%;
        box-sizing: border-box;
    }

    body.page-cartoons-explode #cartoons-explode-root .ce-reel-video {
        width: 100vw;
        height: 100%;
        object-fit: cover;
    }

    body.page-cartoons-explode #cartoons-explode-root #ceLoading:not(.hidden),
    body.page-cartoons-explode #cartoons-explode-root #ceError:not(.hidden),
    body.page-cartoons-explode #cartoons-explode-root #ceEmpty:not(.hidden) {
        position: fixed;
        inset: 0;
        z-index: 200;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 1.5rem;
        background: radial-gradient(1000px 600px at 20% 10%, rgba(107, 151, 196, 0.18) 0%, transparent 55%),
            radial-gradient(900px 600px at 90% 80%, rgba(142, 179, 214, 0.18) 0%, transparent 55%),
            #0a0e14;
    }

    body.page-cartoons-explode #cartoons-explode-root #ceLoading:not(.hidden),
    body.page-cartoons-explode #cartoons-explode-root #ceEmpty:not(.hidden) {
        color: rgba(255, 255, 255, 0.88);
    }

    body.page-cartoons-explode #cartoons-explode-root #ceError:not(.hidden) {
        color: #bcd1e8;
    }
}

/* -------------------------------------------------------------------------- */
/* HLS custom player + modal quiz (aligned with frontend/explode.html)       */
/* -------------------------------------------------------------------------- */

#cartoons-explode-root .ce-modal-player-root,
body.page-cartoons-explode #desktopPlayerModal .ce-modal-player-root {
    min-height: 100%;
    min-width: 100%;
}

#cartoons-explode-root .ce-modal-player-root video.ce-stream-video,
body.page-cartoons-explode #desktopPlayerModal .ce-modal-player-root video.ce-stream-video {
    z-index: 1;
}

#cartoons-explode-root video.ce-stream-video,
#cartoons-explode-root .ce-reel-video.ce-stream-video {
    z-index: 1;
}

#cartoons-explode-root .progress-wrapper,
body.page-cartoons-explode #desktopPlayerModal .progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    width: 100%;
}

/* Seek bar: receive taps above transparent overlays; larger touch target */
#cartoons-explode-root .progress-wrapper.ce-seekable,
body.page-cartoons-explode #desktopPlayerModal .progress-wrapper.ce-seekable {
    pointer-events: auto;
    position: relative;
    z-index: 40;
    padding: 0.35rem 0;
    margin-inline: -0.15rem;
}

#cartoons-explode-root .progress-wrapper.ce-seekable .progress-bar-bg,
body.page-cartoons-explode #desktopPlayerModal .progress-wrapper.ce-seekable .progress-bar-bg {
    min-height: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

#cartoons-explode-root .progress-wrapper.ce-seekable .ce-progress-fill.ce-no-transition,
#cartoons-explode-root .progress-wrapper.ce-seekable.ce-scrubbing .ce-progress-fill,
body.page-cartoons-explode #desktopPlayerModal .progress-wrapper.ce-seekable .ce-progress-fill.ce-no-transition,
body.page-cartoons-explode #desktopPlayerModal .progress-wrapper.ce-seekable.ce-scrubbing .ce-progress-fill {
    transition: none !important;
}

#cartoons-explode-root .ce-progress-fill,
body.page-cartoons-explode #desktopPlayerModal .ce-progress-fill {
    transition: width 0.12s linear;
}

#cartoons-explode-root .ce-center-play-wrap.ce-is-playing,
body.page-cartoons-explode #desktopPlayerModal .ce-center-play-wrap.ce-is-playing {
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

#cartoons-explode-root .modal-info-pane .quiz-option {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 60px;
    padding: 12px 10px;
    margin-top: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
    color: #fff;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#cartoons-explode-root .modal-info-pane .quiz-option:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.02);
}

#cartoons-explode-root .modal-info-pane .ce-quiz-grid .quiz-option {
    margin-top: 0;
}

#cartoons-explode-root .modal-info-pane .ce-modal-quiz-card {
    flex-shrink: 0;
}

#cartoons-explode-root .modal-info-pane .ce-modal-watch-hint {
    flex-shrink: 0;
}

#cartoons-explode-root .modal-info-pane .bg-primary {
    background-color: #6b97c4;
}

#cartoons-explode-root .modal-info-pane .ring-primary {
    --tw-ring-color: #6b97c4;
}

/* Timed interactive quiz overlay (reel + modal player) — above rails, home, controls */
#cartoons-explode-root .ce-timed-quiz-overlay,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-overlay {
    z-index: 500;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#cartoons-explode-root .ce-timed-quiz-modal.ce-timed-quiz-overlay,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-modal.ce-timed-quiz-overlay {
    z-index: 500;
}
#cartoons-explode-root .ce-timed-quiz-overlay.ce-timed-quiz-overlay--hidden,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-overlay.ce-timed-quiz-overlay--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#cartoons-explode-root .ce-timed-quiz-overlay:not(.ce-timed-quiz-overlay--hidden),
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-overlay:not(.ce-timed-quiz-overlay--hidden) {
    pointer-events: auto;
}
#cartoons-explode-root .ce-timed-quiz-backdrop,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-backdrop {
    background: rgba(8, 12, 22, 0.72);
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
}
#cartoons-explode-root .ce-timed-quiz-shell,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-shell {
    border-radius: 1.75rem;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 55%, rgba(107, 151, 196, 0.12) 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 28px 56px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    padding: 1.35rem 1.2rem 1.5rem;
    animation: ce-slideInUp 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#cartoons-explode-root .ce-timed-quiz-shell .ce-timed-quiz-dismiss,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-shell .ce-timed-quiz-dismiss {
    border: none;
    cursor: pointer;
}
#cartoons-explode-root .ce-timed-quiz-shell .quiz-option,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-shell .quiz-option {
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: 60px;
    padding: 12px 10px;
    margin-top: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    width: 100%;
    color: #fff;
    text-align: center;
    transition: background 0.2s ease, transform 0.2s ease;
}
#cartoons-explode-root .ce-timed-quiz-shell .ce-quiz-grid .quiz-option,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-shell .ce-quiz-grid .quiz-option {
    margin-top: 0;
}
#cartoons-explode-root .ce-timed-quiz-shell .quiz-option:hover,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-shell .quiz-option:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.02);
}
#cartoons-explode-root .ce-timed-quiz-shell .quiz-option.ce-quiz-opt-correct,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-shell .quiz-option.ce-quiz-opt-correct {
    background: rgba(107, 151, 196, 0.35);
    border-color: rgba(188, 209, 232, 0.95);
    box-shadow: 0 0 0 2px rgba(107, 151, 196, 0.45);
}
#cartoons-explode-root .ce-timed-quiz-shell .quiz-option.ce-quiz-opt-wrong,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-shell .quiz-option.ce-quiz-opt-wrong {
    background: rgba(58, 99, 148, 0.35);
    border-color: rgba(188, 209, 232, 0.95);
}
#cartoons-explode-root .ce-timed-quiz-shell .quiz-option:disabled,
body.page-cartoons-explode #desktopPlayerModal .ce-timed-quiz-shell .quiz-option:disabled {
    cursor: default;
    opacity: 0.95;
}

/* —— Exceptional kids hero banner (desktop) —— */
#cartoons-explode-root .ce-exc-banner {
    position: relative;
    overflow: hidden;
    border-radius: 2rem;
    margin-bottom: 2.5rem;
    border: 1px solid rgba(125, 180, 232, 0.45);
    background: linear-gradient(115deg, #f0f7ff 0%, #fffdf8 42%, #e8f4fc 100%);
    box-shadow:
        0 22px 50px -28px rgba(47, 74, 107, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

#cartoons-explode-root .ce-exc-banner__glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(48px);
    opacity: 0.55;
}

#cartoons-explode-root .ce-exc-banner__glow--1 {
    width: 220px;
    height: 220px;
    left: -4%;
    top: -40%;
    background: radial-gradient(circle, rgba(107, 151, 196, 0.55) 0%, transparent 70%);
}

#cartoons-explode-root .ce-exc-banner__glow--2 {
    width: 280px;
    height: 280px;
    right: -8%;
    bottom: -55%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, transparent 72%);
}

#cartoons-explode-root .ce-exc-banner__pattern {
    position: absolute;
    inset: 0;
    opacity: 0.07;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L55 45 L5 45 Z' fill='none' stroke='%232f4a6b' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 52px 52px;
    pointer-events: none;
}

#cartoons-explode-root .ce-exc-banner__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.75rem 1.75rem 1.85rem;
}

@media (min-width: 768px) {
    #cartoons-explode-root .ce-exc-banner__content {
        padding: 2rem 2.5rem 2.15rem;
    }
}

#cartoons-explode-root .ce-exc-banner__copy {
    text-align: right;
    flex: 1;
    min-width: 0;
}

#cartoons-explode-root .ce-exc-banner__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4a7ab5;
}

#cartoons-explode-root .ce-exc-banner__headline {
    margin: 0 0 0.5rem;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    font-weight: 900;
    line-height: 1.35;
    color: #1e3a5f;
}

#cartoons-explode-root .ce-exc-banner__lead {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.75;
    color: #5a6f86;
    max-width: 36rem;
}

#cartoons-explode-root .ce-exc-banner__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

#cartoons-explode-root .ce-exc-banner__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #2f4a6b;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(107, 151, 196, 0.28);
    box-shadow: 0 2px 8px rgba(47, 74, 107, 0.06);
}

#cartoons-explode-root .ce-exc-banner__art {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cartoons-explode-root .ce-exc-banner__orb {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff 0%, #e8f2fb 100%);
    border: 2px solid rgba(107, 151, 196, 0.35);
    box-shadow:
        0 16px 36px -12px rgba(107, 151, 196, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: ce-float-gentle 4.5s ease-in-out infinite;
}

@media (min-width: 768px) {
    #cartoons-explode-root .ce-exc-banner__orb {
        width: 6.75rem;
        height: 6.75rem;
        border-radius: 2rem;
    }
}

#cartoons-explode-root .ce-exc-banner__orb-icon {
    font-size: 2.35rem;
    color: #5a8bc4;
}

@media (max-width: 640px) {
    #cartoons-explode-root .ce-exc-banner__art {
        display: none;
    }
}

/* —— Exceptional banner (mobile, above reels) —— */
#cartoons-explode-root .ce-exc-banner-mobile {
    flex-shrink: 0;
    margin: 0.5rem 0.75rem 0.35rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(125, 180, 232, 0.4);
    background: linear-gradient(120deg, #f0f7ff 0%, #fffdf8 100%);
    box-shadow: 0 10px 28px -18px rgba(47, 74, 107, 0.35);
}

#cartoons-explode-root .ce-exc-banner-mobile__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    text-align: right;
}

#cartoons-explode-root .ce-exc-banner-mobile__icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(107, 151, 196, 0.3);
    color: #5a8bc4;
    font-size: 1.25rem;
}

#cartoons-explode-root .ce-exc-banner-mobile__kicker {
    margin: 0;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #4a7ab5;
    text-transform: uppercase;
}

#cartoons-explode-root .ce-exc-banner-mobile__title {
    margin: 0.1rem 0 0;
    font-size: 1rem;
    font-weight: 900;
    color: #1e3a5f;
    line-height: 1.25;
}

#cartoons-explode-root .ce-exc-banner-mobile__sub {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: #5a6f86;
    line-height: 1.35;
}
