/* ── Clever Reel Frontend ─────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

#cr-app {
    position: fixed;
    inset: 0;
    background: #141414;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    z-index: 99999;
    overflow: hidden;
}

/* ════════════════════════════════════════════════
   AUTH SCREEN
════════════════════════════════════════════════ */
#cr-auth-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cr-auth-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.8) 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect fill="%23111" width="100" height="100"/><rect fill="%231a1a1a" x="0" y="0" width="50" height="50"/><rect fill="%231a1a1a" x="50" y="50" width="50" height="50"/></svg>');
    background-size: 50px 50px;
}

.cr-auth-box {
    position: relative;
    background: rgba(0,0,0,0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(10px);
}

.cr-auth-logo {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    color: #e50914;
    margin-bottom: 28px;
    letter-spacing: 1px;
}

.cr-auth-box h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
}

.cr-auth-sub {
    font-size: 14px;
    color: #aaa;
    text-align: center;
    margin-bottom: 20px;
}

.cr-auth-input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    padding: 14px 16px;
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.cr-auth-input:focus { border-color: #e50914; }

.cr-code-input {
    font-size: 28px;
    letter-spacing: 16px;
    text-align: center;
    font-weight: 700;
}

.cr-auth-btn {
    width: 100%;
    background: var(--cr-btn-send-code-bg, #e50914);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    padding: 14px;
    cursor: pointer;
    margin-bottom: 12px;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}

.cr-auth-btn:hover { background: var(--cr-btn-send-code-hover, #c40812); }
.cr-auth-btn:active { transform: scale(0.98); }

.cr-auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.cr-auth-switch {
    text-align: center;
    font-size: 14px;
    color: #aaa;
    margin-top: 8px;
}

.cr-auth-link {
    background: none;
    border: none;
    color: #e50914;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    text-decoration: underline;
    padding: 0 4px;
}

.cr-auth-error {
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
    margin-top: 8px;
    min-height: 18px;
}

/* ════════════════════════════════════════════════
   APP SHELL
════════════════════════════════════════════════ */
#cr-app-shell {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── Hamburger ── */
#cr-hamburger {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    background: var(--cr-btn-hamburger-bg, rgba(0,0,0,0.6));
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

#cr-hamburger:hover { background: var(--cr-btn-hamburger-hover, rgba(229,9,20,0.8)); }

#cr-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}

#cr-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#cr-hamburger.open span:nth-child(2) { opacity: 0; }
#cr-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Nav Menu ── */
#cr-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 900;
    display: none;
    backdrop-filter: blur(2px);
}

#cr-nav-overlay.open { display: block; }

#cr-nav-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100%;
    background: #0d0d0d;
    z-index: 950;
    transition: left 0.3s ease;
    padding: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
}

#cr-nav-menu.open { left: 0; }

.cr-nav-logo {
    padding: 24px 20px 20px;
    font-size: 20px;
    font-weight: 800;
    color: #e50914;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

#cr-nav-menu ul {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

#cr-nav-menu ul li a,
#cr-logout-link {
    display: block;
    padding: 14px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

#cr-nav-menu ul li a:hover,
#cr-logout-link:hover {
    background: rgba(229,9,20,0.1);
    color: #fff;
    border-left-color: #e50914;
}

.cr-nav-email {
    padding: 16px 20px;
    font-size: 12px;
    color: #555;
    border-top: 1px solid rgba(255,255,255,0.06);
    word-break: break-all;
}

/* ── Views ── */
.cr-view { display: none; min-height: 100vh; }
.cr-view.active { display: block; animation: crViewIn 0.25s ease; }
@keyframes crViewIn { from { opacity: 0; } to { opacity: 1; } }

.cr-view-inner {
    padding: 80px 40px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.cr-view-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* ════════════════════════════════════════════════
   SLIDESHOW
════════════════════════════════════════════════ */
#cr-slideshow {
    position: relative;
    height: 55vw;
    max-height: 600px;
    overflow: hidden;
    background: #000;
}

#cr-slides-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.cr-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    background-size: cover;
    background-position: center;
}

.cr-slide-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20,20,20,0.95) 0%, rgba(20,20,20,0.3) 50%, transparent 100%);
}

.cr-slide-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 40px;
}

.cr-slide-title {
    font-size: clamp(20px, 3vw, 42px);
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    margin-bottom: 8px;
}

.cr-slide-desc {
    font-size: 14px;
    color: #ccc;
    max-width: 500px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cr-slide-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
    font-family: inherit;
}

.cr-slide-btn:hover { background: rgba(229,9,20,0.7); border-color: #e50914; }

/* Slide arrows */
.cr-slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 48px;
    height: 64px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    border-radius: 4px;
}

.cr-slide-arrow:hover { background: rgba(229,9,20,0.8); }
.cr-slide-prev { left: 0; border-radius: 0 4px 4px 0; }
.cr-slide-next { right: 0; border-radius: 4px 0 0 4px; }

/* Slide dots */
#cr-slide-dots {
    position: absolute;
    bottom: 16px;
    right: 40px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.cr-slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.2s;
}

.cr-slide-dot.active {
    background: #e50914;
    width: 24px;
}

/* ════════════════════════════════════════════════
   HOME CONTENT — Category Rows
════════════════════════════════════════════════ */
#cr-home-content { padding: 20px 0 60px; }

.cr-category-row { margin-bottom: 52px; }

.cr-category-title {
    font-size: 22px;
    font-weight: 700;
    padding: 0 40px 14px;
    color: #fff;
}

.cr-category-title.cr-popular-title {
    color: #e50914;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cr-thumbnails-wrap {
    position: relative;
    overflow: hidden;
}

/* Desktop scroll arrows — hidden on touch devices via JS class */
.cr-row-arrow {
    display: none; /* shown only on non-touch via JS */
    position: absolute;
    top: 0;
    bottom: 0;
    width: 56px;
    border: none;
    cursor: pointer;
    z-index: 20;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    transition: background 0.2s;
}

.cr-row-arrow-left  { left: 0;  background: linear-gradient(to right, rgba(20,20,20,0.95) 60%, transparent); border-radius: 6px 0 0 6px; }
.cr-row-arrow-right { right: 0; background: linear-gradient(to left,  rgba(20,20,20,0.95) 60%, transparent); border-radius: 0 6px 6px 0; }
.cr-row-arrow:hover { color: #e50914; }
.cr-row-arrow span  { pointer-events: none; }

.cr-thumbnails {
    display: flex;
    gap: 8px;
    padding: 0 40px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cr-thumbnails::-webkit-scrollbar { display: none; }

.cr-thumb-card {
    min-width: 160px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: #1f1f1f;
    flex-shrink: 0;
    position: relative;
}

.cr-thumb-card:hover {
    transform: scale(1.06) translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.7);
    z-index: 10;
}

.cr-thumb-img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    display: block;
    background: #2a2a2a;
}

.cr-thumb-no-img {
    width: 100%;
    aspect-ratio: 9/16;
    background: linear-gradient(135deg, #1f1f2e, #2a2a3a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.cr-thumb-label {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr-thumb-rent-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #e50914;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Skeleton */
.cr-skeleton-rows { padding: 20px 40px; }
.cr-skeleton-row {
    height: 200px;
    background: linear-gradient(90deg, #1f1f1f 25%, #2a2a2a 50%, #1f1f1f 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 20px;
}
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ════════════════════════════════════════════════
   OPTIONS POPUP
════════════════════════════════════════════════ */
#cr-options-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

#cr-options-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2100;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: crPopIn 0.25s ease;
}

@keyframes crPopIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.cr-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cr-popup-close:hover { background: #e50914; }

.cr-popup-poster {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #2a2a2a;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.cr-popup-inner { padding: 20px; }

.cr-popup-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.cr-popup-short-desc {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 18px;
    line-height: 1.5;
}

#cr-popup-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cr-popup-btn {
    width: 100%;
    padding: 14px 18px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cr-popup-play-btn { background: var(--cr-btn-play-bg, #e50914); color: #fff; }
.cr-popup-play-btn:hover { background: var(--cr-btn-play-hover, #c40812); }

.cr-popup-episodes-btn, .cr-popup-info-btn { background: var(--cr-btn-more-info-bg, rgba(255,255,255,0.08)); color: #fff; }
.cr-popup-episodes-btn:hover, .cr-popup-info-btn:hover { background: var(--cr-btn-more-info-hover, rgba(255,255,255,0.15)); }

.cr-popup-fav-btn { background: var(--cr-btn-favorites-bg, transparent); color: #aaa; border: 1px solid rgba(255,255,255,0.15); }
.cr-popup-fav-btn:hover { background: var(--cr-btn-favorites-hover, rgba(255,255,255,0.08)); color: #fff; border-color: rgba(255,255,255,0.4); }
.cr-popup-fav-btn.favorited { color: #e50914; border-color: #e50914; }

.cr-popup-back-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    padding: 0 0 14px;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
}

.cr-popup-back-btn:hover { color: #fff; }

/* Episodes list */
#cr-episodes-list { display: flex; flex-direction: column; gap: 10px; }

.cr-episode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.cr-episode-item:hover { background: rgba(255,255,255,0.1); }
.cr-episode-item.watched { border-color: rgba(229,9,20,0.3); }

.cr-episode-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.cr-episode-item.watched .cr-episode-num { background: #e50914; }

.cr-episode-info { flex: 1; min-width: 0; }
.cr-episode-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-episode-desc { font-size: 12px; color: #888; margin-top: 2px; }

/* More Info */
#cr-popup-long-desc { font-size: 14px; color: #ccc; line-height: 1.7; }

/* Rental info in popup */
.cr-popup-rent-notice {
    background: rgba(229,9,20,0.1);
    border: 1px solid rgba(229,9,20,0.3);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #ff9999;
    margin-bottom: 12px;
    text-align: center;
}

/* ════════════════════════════════════════════════
   VIDEO PLAYER
════════════════════════════════════════════════ */
#cr-player-container {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 3000;
    display: flex;
    flex-direction: column;
}

#cr-player-close-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    z-index: 100;
    font-family: inherit;
    transition: background 0.2s;
}

#cr-player-close-btn:hover { background: #e50914; border-color: #e50914; }

/* Ad layer */
#cr-ad-layer {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#cr-ad-countdown {
    position: absolute;
    top: 60px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 20;
}

#cr-ad-player-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

#cr-ad-yt-player { width: 100%; height: 100%; }

#cr-ad-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

#cr-ad-visit-btn {
    position: absolute;
    bottom: 60px;
    right: 20px;
    background: rgba(229,9,20,0.9);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    z-index: 20;
}

#cr-ad-visit-btn:hover { background: #e50914; }

/* Main player */
#cr-main-player-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

#cr-yt-player { width: 100% !important; height: 100% !important; }

/* Orientation classes applied by JS */
#cr-player-container.portrait { justify-content: center; }
#cr-player-container.portrait #cr-main-player-wrap,
#cr-player-container.portrait #cr-ad-player-wrap {
    max-width: calc(100vh * 9 / 16);
    max-height: 100vh;
    margin: 0 auto;
}

/* ── Merch End Card ── */
#cr-merch-endcard {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 30;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
    padding: 40px;
    animation: crFadeIn 0.4s ease;
}

@keyframes crFadeIn { from { opacity: 0; } to { opacity: 1; } }

#cr-merch-endcard h2 {
    font-size: clamp(22px, 4vw, 40px);
    font-weight: 800;
    color: #fff;
}

#cr-merch-btn {
    background: var(--cr-btn-merch-bg, #e50914);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s, transform 0.15s;
}

#cr-merch-btn:hover { background: var(--cr-btn-merch-hover, #c40812); transform: scale(1.04); }

#cr-merch-dismiss {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #aaa;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

#cr-merch-dismiss:hover { color: #fff; border-color: rgba(255,255,255,0.6); } — transparent overlay covering YouTube's bottom-left controls */
#cr-yt-share-blocker {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 120px;   /* wide enough to cover share icon */
    height: 52px;   /* tall enough to cover the control bar */
    z-index: 10;
    background: transparent;
    pointer-events: all; /* eat clicks */
}

/* Custom fullscreen button */
#cr-player-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 20px;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

#cr-player-fav-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #ccc;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

#cr-player-fav-btn:hover { color: #fff; border-color: rgba(255,255,255,0.6); }
#cr-player-fav-btn.favorited { color: #e50914; border-color: #e50914; }

#cr-fullscreen-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: #ccc;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: inherit;
}

#cr-fullscreen-btn:hover { color: #fff; border-color: rgba(255,255,255,0.6); }

/* When OUR container is the fullscreen element */
#cr-player-container:fullscreen,
#cr-player-container:-webkit-full-screen,
#cr-player-container:-moz-full-screen,
#cr-player-container:-ms-fullscreen {
    background: #000;
}

#cr-player-container:fullscreen #cr-player-close-btn,
#cr-player-container:-webkit-full-screen #cr-player-close-btn,
#cr-player-container:-moz-full-screen #cr-player-close-btn,
#cr-player-container:-ms-fullscreen #cr-player-close-btn {
    position: fixed;
}

#cr-player-container:fullscreen #cr-player-controls,
#cr-player-container:-webkit-full-screen #cr-player-controls,
#cr-player-container:-moz-full-screen #cr-player-controls,
#cr-player-container:-ms-fullscreen #cr-player-controls {
    position: absolute;
}

/* Favorites bar legacy — removed, now inside #cr-player-controls */
#cr-favorite-bar { display: none; }


/* ════════════════════════════════════════════════
   SEARCH VIEW
════════════════════════════════════════════════ */
.cr-search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.cr-search-bar input {
    flex: 1;
    min-width: 200px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    padding: 12px 16px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.cr-search-bar input:focus { border-color: #e50914; }

.cr-search-bar select {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    padding: 12px 14px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

/* ════════════════════════════════════════════════
   VIDEO GRID (Search + Favorites)
════════════════════════════════════════════════ */
.cr-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.cr-video-grid .cr-thumb-card { min-width: auto; }

.cr-empty-msg {
    color: #555;
    font-size: 16px;
    text-align: center;
    padding: 60px 0;
    grid-column: 1 / -1;
}

/* ════════════════════════════════════════════════
   ACCOUNT
════════════════════════════════════════════════ */
.cr-account-box { max-width: 480px; }

.cr-account-form label {
    display: block;
    font-size: 13px;
    color: #aaa;
    margin-bottom: 6px;
    margin-top: 16px;
}

.cr-field {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    padding: 12px 16px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.cr-field:focus { border-color: #e50914; }

.cr-primary-btn {
    margin-top: 20px;
    background: #e50914;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.cr-primary-btn:hover { background: #c40812; }

.cr-msg { margin-top: 10px; font-size: 14px; }
.cr-msg.success { color: #4caf50; }
.cr-msg.error { color: #ff6b6b; }

/* ════════════════════════════════════════════════
   RENTAL MODAL
════════════════════════════════════════════════ */
#cr-rental-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 4000;
    backdrop-filter: blur(4px);
}

#cr-rental-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4100;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 440px;
    text-align: center;
    animation: crPopIn 0.25s ease;
}

#cr-rental-modal h2 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }

#cr-rental-price { font-size: 32px; font-weight: 800; color: #e50914; margin: 12px 0; }

.cr-rental-note { font-size: 13px; color: #888; margin-bottom: 20px; }

#cr-paypal-button-container { margin-top: 16px; }

/* ════════════════════════════════════════════════
   TOAST
════════════════════════════════════════════════ */
#cr-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(30,30,30,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 9999;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

#cr-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #cr-slideshow { height: 70vw; max-height: 400px; }
    .cr-slide-info { padding: 20px; }
    .cr-slide-arrows { display: none; }
    .cr-category-title { padding: 0 16px 10px; font-size: 16px; }
    .cr-thumbnails { padding: 0 16px; gap: 6px; }
    /* ~3.5 cards visible: (100vw - 32px padding - 3x6px gaps) / 3.5 */
    .cr-thumb-card { min-width: calc((100vw - 50px) / 3.5); max-width: calc((100vw - 50px) / 3.5); }
    .cr-view-inner { padding: 70px 16px 40px; }
    .cr-account-box { max-width: 100%; }
    #cr-options-popup { width: 95%; max-width: 95%; }
    .cr-popup-poster { height: 150px; }
}

@media (max-width: 480px) {
    .cr-thumbnails { gap: 5px; }
    .cr-thumb-card { min-width: calc((100vw - 45px) / 3.5); max-width: calc((100vw - 45px) / 3.5); }
    .cr-thumb-label { font-size: 10px; padding: 5px 6px; }
    .cr-video-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); }
}
.cr-store-card { cursor: pointer; }

/* ── Stores search bar ─────────────────────────────────────── */
.cr-stores-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 16px;
}

.cr-stores-search-bar input {
    flex: 1;
    padding: 10px 14px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.cr-stores-search-bar input:focus {
    border-color: #555;
}

/* ── Shared filter button (Stores + Search Vids) ───────────── */
.cr-filter-btn {
    padding: 10px 20px;
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.cr-filter-btn:hover {
    background: #444;
}

/* ── Search Vids — filter button alignment ─────────────────── */
.cr-search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════════
   FRONT PAGE (pre-login)  — added v1.0.8
═══════════════════════════════════════════════════════════════ */

#cr-front-page {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    color: #fff;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Background */
#cr-fp-bg {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 0;
    opacity: 0.35;
    pointer-events: none;
}

/* Top Bar */
#cr-fp-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    height: 68px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    backdrop-filter: blur(2px);
}

#cr-fp-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#cr-fp-logo-wrap img {
    max-height: 42px;
    max-width: 140px;
    object-fit: contain;
    display: block;
}

#cr-fp-brand-name {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #e50914;
    white-space: nowrap;
}

#cr-fp-topbar-right {}

#cr-fp-signin-btn {
    background: var(--cr-btn-send-code-bg, #e50914);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    letter-spacing: .3px;
}
#cr-fp-signin-btn:hover {
    background: var(--cr-btn-send-code-hover, #c40812);
}

/* Main Content */
#cr-fp-main {
    position: relative;
    z-index: 1;
    padding-bottom: 60px;
}

/* Dynamic content block */
#cr-fp-content-area {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px 40px;
    text-align: center;
    line-height: 1.6;
}
#cr-fp-content-area img { max-width: 100%; height: auto; border-radius: 8px; }
#cr-fp-content-area h1, #cr-fp-content-area h2, #cr-fp-content-area h3 { margin: .5em 0; }

/* Registration Block */
#cr-fp-register-block {
    max-width: 480px;
    margin: 0 auto 60px;
    padding: 40px 32px;
    background: transparent;
    border-radius: 12px;
    text-align: center;
}
#cr-fp-register-block h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 8px;
}
.cr-fp-sub {
    color: #aaa;
    font-size: 14px;
    margin: 0 0 20px;
    line-height: 1.5;
}
.cr-fp-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 14px;
    outline: none;
    transition: border-color .2s;
}
.cr-fp-input:focus { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.14); }
.cr-fp-input::placeholder { color: #666; }
.cr-fp-code-input { letter-spacing: 10px; font-size: 22px; text-align: center; }

.cr-fp-btn-primary {
    display: block;
    width: 100%;
    background: var(--cr-btn-send-code-bg, #e50914);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
    transition: background .2s, opacity .2s;
    letter-spacing: .3px;
}
.cr-fp-btn-primary:hover { background: var(--cr-btn-send-code-hover, #c40812); }
.cr-fp-btn-primary:disabled { opacity: .6; cursor: default; }

.cr-fp-btn-link {
    background: none;
    border: none;
    color: #e50914;
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
    text-decoration: underline;
    display: block;
    margin: 0 auto;
}
.cr-fp-btn-link:hover { color: #ff6b6b; }

.cr-fp-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
    text-align: center;
}

/* ── Section titles ── */
.cr-fp-section-title {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 800;
    margin: 0 0 20px;
    padding: 0 24px;
}

/* ── Popular This Week ── */
#cr-fp-popular-section {
    padding: 20px 0 40px;
}
#cr-fp-popular-wrap {
    overflow-x: auto;
    padding: 0 24px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
#cr-fp-popular-track {
    display: flex;
    gap: 12px;
    width: max-content;
}
.cr-fp-thumb-card {
    width: 160px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a1a;
    /* non-clickable: no cursor pointer */
}
.cr-fp-thumb-img {
    display: block;
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    background: #2a2a2a;
}
.cr-fp-thumb-no-img {
    width: 100%;
    aspect-ratio: 9/16;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, #1f1f2e, #2a2a3a);
}
.cr-fp-thumb-label {
    padding: 8px 10px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #ccc;
}

/* ── FAQ ── */
#cr-fp-faq-section {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 24px 40px;
}
.cr-fp-faq-item {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cr-fp-faq-item:first-child { border-top: 1px solid rgba(255,255,255,0.08); }
#cr-app .cr-fp-faq-q {
    width: 100%;
    background: var(--cr-btn-faq-bg, rgba(255,255,255,0.04)) !important;
    border: none !important;
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    padding: 20px 20px 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: background .15s;
    outline: none;
    box-shadow: none !important;
}
#cr-app .cr-fp-faq-q:hover,
#cr-app .cr-fp-faq-q:focus {
    background: var(--cr-btn-faq-hover, rgba(255,255,255,0.08)) !important;
    color: #fff !important;
    box-shadow: none !important;
}
.cr-fp-faq-icon {
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    color: #aaa;
    flex-shrink: 0;
}
.cr-fp-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
    font-size: 15px;
    line-height: 1.7;
    color: #ccc;
    padding: 0 24px;
}
.cr-fp-faq-item.open .cr-fp-faq-a {
    max-height: 600px;
    padding: 16px 24px 24px;
}

/* ── Footer ── */
#cr-fp-footer-area {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 40px 48px;
    color: #777;
    font-size: 13px;
    line-height: 1.8;
}
#cr-fp-footer-area a { color: #aaa; text-decoration: none; }
#cr-fp-footer-area a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════
   SIGN IN POPUP
════════════════════════════════════════════════════════════════ */
#cr-signin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 9000;
    backdrop-filter: blur(4px);
}
#cr-signin-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9001;
    background: #141414;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 40px 36px 36px;
    width: min(420px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 24px 64px rgba(0,0,0,0.8);
}
#cr-signin-popup h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
    text-align: center;
}
#cr-signin-popup .cr-fp-sub { text-align: center; }
#cr-signin-popup .cr-fp-error { text-align: center; }

#cr-signin-close-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color .2s, background .2s;
}
#cr-signin-close-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

#cr-signin-brand-area {
    text-align: center;
    margin-bottom: 20px;
}
#cr-signin-logo-wrap img {
    max-height: 60px;
    max-width: 180px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
}
#cr-signin-brand-name {
    font-size: 22px;
    font-weight: 900;
    color: #e50914;
    margin-bottom: 4px;
}

/* Mobile tweaks */
@media (max-width: 600px) {
    #cr-fp-topbar { padding: 0 16px; }
    #cr-fp-footer-area { padding: 30px 20px; }
    #cr-fp-register-block { margin: 0 16px 48px; padding: 28px 20px; }
    #cr-fp-content-area { padding: 40px 16px 30px; }
}
