/* 
   QF-RG OBSIDIAN ELITE 5.7
   Strict Aspect Ratio | Unmuted Default | No-Distortion Logic
*/

:root {
    --primary: #fe2c55;
    --primary-glow: rgba(254, 44, 85, 0.4);
    --bg-pure: #000000;
    --bg-glass: rgba(18, 18, 18, 0.9);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-silver: #a1a1aa;
    --lane-width: 500px;
}


* { margin:0; padding:0; box-sizing:border-box; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; -webkit-tap-highlight-color: transparent; }

body, html { width:100%; height:100%; background:#000; color:#fff; overflow:hidden; }

a { text-decoration: none !important; color: inherit; border:none !important; }
button { border:none !important; background:none; outline:none !important; cursor:pointer; }

/* THE LANE */
.rg-app-wrapper { width:100%; height:100dvh; display:flex; justify-content:center; background:#000; overflow: hidden; }
.rg-main-viewport { width:100%; max-width:var(--lane-width); height:100dvh; position:relative; background:#000; box-shadow:0 0 100px #000; z-index: 10; }

/* FEED SYSTEM (STRICT SCROLL SNAPPING) */
.rg-feed-container { width:100%; height:100dvh; overflow-y:scroll; scroll-snap-type:y mandatory; transition: opacity 0.3s; position: relative; z-index: 5; }

/* Custom Obsidian Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; border: 2px solid #000; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Hide on Mobile */
@media (max-width: 768px) {
    .rg-feed-container { scrollbar-width: none; }
    .rg-feed-container::-webkit-scrollbar { display: none; }
    ::-webkit-scrollbar { display: none; }
}
.rg-video-slot { 
    width:100%; 
    height:100dvh; 
    scroll-snap-align:start; 
    scroll-snap-stop:always; 
    position:relative; 
    overflow:hidden; 
    background: #000; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    content-visibility: auto;
    contain-intrinsic-size: 100dvh;
}
.rg-highlight-lane { 
    width:100%; 
    height:100dvh; 
    scroll-snap-align:start; 
    scroll-snap-stop:always; 
    position:relative; 
    overflow:hidden; 
    background: #000; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    content-visibility: auto;
    contain-intrinsic-size: 100dvh;
}
.rg-highlight-lane > * {
    max-width: 100%;
    margin: 0 auto;
    display: inline-block;
}
/* Ensure iframes from ad networks respect centering */
.rg-highlight-lane iframe {
    margin: 0 auto !important;
    display: block !important;
}

/* DYNAMIC STATUS FIX */
.rg-highlight-lane {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Only show Secondary items IF successfully loaded (prevents blank spaces) */
.rg-highlight-lane.v-item-s.is-loaded {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100dvh !important;
    width: 100% !important;
}

/* Only show Primary lanes if the system confirms it's clean */
html.v-safe .rg-highlight-lane {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100dvh !important;
    width: 100% !important;
}

/* Force ad-network iframes to fill the unit correctly */
.rg-highlight-lane iframe {
    width: 100% !important;
    max-width: 100vw !important;
    height: auto !important;
    min-height: 250px;
    border: none !important;
}

.v-base-p { display: none !important; }
html.v-safe .v-base-p { display: flex !important; }

.rg-video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    background: #000;
    will-change: transform;
}

/* Embed player framing. UI elements (titles/logos) are now stripped 
   server-side in api/embed.php, so we use standard scaling. */
iframe.rg-video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    background: #000;
}

/* Subtle vignettes for depth, no longer needing solid masks */
.rg-video-slot::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 100px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 10;
    pointer-events: none;
}
.rg-video-slot::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 140px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    z-index: 10;
    pointer-events: none;
}

/* PLAY OVERLAY */
.rg-play-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: opacity 0.3s, visibility 0.3s;
}

/* SEARCH NICHES */
.rg-search-niches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}
.rg-niche-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none !important;
}
.rg-niche-item:hover, .rg-niche-item.active {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    color: #fff !important;
}

/* FEED TABS */
.rg-feed-tabs {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
}
.rg-feed-tabs::-webkit-scrollbar { display: none; }
.rg-feed-tab {
    font-size: 17px;
    font-weight: 900;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding: 10px 0;
}
.rg-feed-tab.active {
    color: #fff;
}
.rg-feed-tab.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

.rg-play-btn {
    width: 80px;
    height: 80px;
    background: rgba(254, 44, 85, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(254, 44, 85, 0.4);
    transition: transform 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.rg-play-btn svg {
    width: 40px;
    height: 40px;
    color: #fff;
    margin-left: 5px;
}

.rg-video-slot[data-playing="true"] .rg-play-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.rg-play-btn:hover {
    transform: scale(1.1);
}

/* UI OVERLAYS */
.rg-header { position:absolute; top:0; left:0; width:100%; height:80px; z-index:1000; display:flex; align-items:center; justify-content:space-between; padding:0 24px; background:linear-gradient(to bottom, rgba(0,0,0,0.8), transparent); pointer-events:none; }
.rg-header * { pointer-events: auto; }
.rg-logo { font-size:24px; font-weight:900; letter-spacing:-1px; text-transform:uppercase; color: #fff; }
.rg-logo span { color:var(--primary); }

.rg-action-stack { position:absolute; right:12px; bottom:140px; display:flex; flex-direction:column; align-items:center; gap:20px; z-index:100; color: #fff; }
.rg-action-item { display:flex; flex-direction:column; align-items:center; gap:4px; transition: transform 0.1s, opacity 0.2s; color: #fff; cursor: pointer; border: none; background: none; width: 50px; }
.rg-action-item:active { transform: scale(0.9); }
.rg-action-item:hover { opacity: 0.8; }
.rg-action-item svg { width:34px; height:34px; filter:drop-shadow(0 2px 10px rgba(0,0,0,0.5)); fill: currentColor; }
.rg-action-count { font-size:11px; font-weight:800; text-shadow:0 1px 4px #000; color: #fff; margin-top: -2px; }

.rg-meta-block { position:absolute; bottom:105px; left:16px; right:85px; z-index:90; pointer-events:none; text-shadow: 0 1px 4px #000; }
.rg-author { font-size:18px; font-weight:900; margin-bottom:6px; pointer-events:auto; color: #fff; display: block; }
.rg-desc { font-size:14px; color:rgba(255,255,255,0.85); line-height:1.4; pointer-events:auto; }

.rg-tags { margin-top: 8px; pointer-events:auto; }
.rg-tag { display: inline-block; margin-right: 6px; margin-bottom: 6px; font-size:11px; font-weight:800; color: #fff; background: rgba(255,255,255,0.15); padding: 3px 8px; border-radius: 6px; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.05); transition: background 0.2s; text-shadow: none; letter-spacing: 0.5px; }
.rg-tag:hover { background: rgba(255,255,255,0.25); }
/* SCROLL NAV */
.rg-scroll-nav { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 1200; pointer-events: none; }
.scroll-btn { width: 44px; height: 44px; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; pointer-events: auto; opacity: 0; transition: opacity 0.3s, background 0.2s; border: 1px solid rgba(255,255,255,0.1); }
.rg-main-viewport:hover .scroll-btn { opacity: 1; }
.scroll-btn:hover { background: var(--primary); }
.scroll-btn svg { width: 28px; height: 28px; }
@media (max-width: 768px) { .rg-scroll-nav { display: none; } }

/* HEADER REFINEMENT */
.rg-header-left, .rg-header-right { flex: 1; display: flex; align-items: center; }
.rg-header-right { justify-content: flex-end; }

@media (max-width: 768px) {
    .rg-header-left { display: none !important; }
}

.rg-niche-bar {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    height: 50px;
    z-index: 1000;
    overflow-x: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    scrollbar-width: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
    pointer-events: none;
    -webkit-overflow-scrolling: touch;
}
.rg-niche-bar::-webkit-scrollbar { display: none; }
.rg-niche-bar * { pointer-events: auto; }

.rg-niche-item {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    white-space: nowrap;
}
.rg-niche-item:hover, .rg-niche-item.active {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.sidebar-logo-container, .sidebar-compliance-links { display: none !important; }

.rg-nav-bar { 
    position:absolute; 
    bottom:calc(10px + env(safe-area-inset-bottom, 0px)); 
    left:16px; 
    right:16px; 
    height:64px; 
    background:rgba(22, 22, 22, 0.85); 
    backdrop-filter:blur(40px); 
    border:1px solid var(--border-glass); 
    border-radius:32px; 
    z-index:1100; 
    display:flex; 
    align-items:center; 
    justify-content:space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.rg-nav-item { color:rgba(255,255,255,0.4); display:flex; flex-direction:column; align-items:center; gap:4px; font-size:9px; font-weight:900; text-transform:uppercase; transition: color 0.2s; text-decoration:none; }
.rg-nav-item.active { color:#fff; }
.rg-nav-item svg { width:22px; height:22px; }

.rg-nav-upload-pill { width:48px; height:32px; background:linear-gradient(135deg, var(--primary), #ff6b8a); border-radius:10px; position:relative; display:flex; align-items:center; justify-content:center; margin-bottom:2px; box-shadow:0 2px 12px rgba(254,44,85,0.35); transition:transform 0.2s, box-shadow 0.2s; }
.rg-nav-upload-pill:hover { transform:scale(1.08); box-shadow:0 4px 20px rgba(254,44,85,0.5); }
.rg-nav-upload-pill svg { color:#fff; width:20px; height:20px; filter:drop-shadow(0 1px 2px rgba(0,0,0,0.2)); }

/* MODALS & DRAWERS (GUARANTEED NATIVE) */
.rg-modal { position:absolute; inset:0; background:#000; z-index:2000; transform:translateY(100%); transition:transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); display:flex; flex-direction:column; overflow: hidden; }
.rg-modal.active { transform:translateY(0); }

.rg-modal-header { height:80px; display:flex; align-items:center; justify-content:space-between; padding:0 24px; border-bottom:1px solid var(--border-glass); }
.rg-modal-title { font-size:14px; font-weight:900; text-transform:uppercase; letter-spacing:1px; }

.modal-close { width:32px; height:32px; background:rgba(255,255,255,0.06); border-radius:50%; display:flex; align-items:center; justify-content:center; border:1px solid var(--border-glass); transition: all 0.2s; cursor:pointer; }
.modal-close:hover { background:var(--primary); transform:rotate(90deg); }

/* GRID VIEW */
.rg-grid-scroll { flex:1; overflow-y:auto; padding-bottom:120px; }
.rg-grid-view { display:grid; grid-template-columns:repeat(2, 1fr); gap:1px; background:#000; }
.grid-item { aspect-ratio:9/16; background:#0d0d0d; cursor:pointer; position:relative; overflow:hidden; }
.grid-item video { width:100%; height:100%; object-fit:cover; opacity: 0.6; }

/* DRAWER (COMMENT/INBOX) */
.rg-drawer { position:absolute; bottom:0; left:0; width:100%; height:75%; background:#111; z-index:2500; border-radius:24px 24px 0 0; transform:translateY(100%); transition:transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); border-top:1px solid var(--border-glass); display:flex; flex-direction:column; box-shadow: 0 -10px 40px rgba(0,0,0,1); }
.rg-drawer.active { transform:translateY(0); }

/* FORMS (ELITE FORMATTING) */
.rg-modal-content { flex: 1; overflow-y: auto; padding: 40px 24px; }
.form-group { margin-bottom: 24px; }
.form-label { display: block; font-size: 11px; font-weight: 900; color: #555; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 1px; }
.rg-input { width: 100%; background: #0a0a0a; border: 1px solid var(--border-glass); padding: 16px; border-radius: 12px; color: #fff; font-size: 14px; transition: border-color 0.2s; }
.rg-input:focus { border-color: var(--primary); outline: none; }
.rg-btn { width: 100%; background: var(--primary); color: #fff; font-weight: 900; padding: 18px; border-radius: 14px; text-transform: uppercase; font-size: 13px; letter-spacing: 1px; cursor: pointer; border: none; }
.rg-btn:active { transform: scale(0.98); }

/* GUEST SCREENS */
.screen-empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:40px; }
.icon-shield { width:80px; height:80px; background:rgba(255,255,255,0.03); border-radius:50%; display:flex; align-items:center; justify-content:center; margin-bottom:30px; border: 1px solid rgba(255,255,255,0.05); }

/* MENTIONS */
.mention-link { color: var(--primary); font-weight: 700; text-decoration: none; transition: opacity 0.2s; }
.mention-link:hover { text-decoration: underline; opacity: 0.8; }

/* BADGES */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    cursor: default;
    transition: transform 0.2s;
}
.badge-pill:hover { transform: translateY(-2px); }
.badge-viral_hit { background: #ff6b35; }
.badge-trending_star { background: #f7c948; color: #000; }
.badge-comment_magnet { background: #51cf66; }
.badge-rising_creator { background: #4dabf7; }
.badge-elite_creator { background: #be4bdb; }

/* INBOX & THREAD */
.inbox-thread {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
    transition: background 0.15s;
}
.inbox-thread:hover { background: rgba(255,255,255,0.04); }
.inbox-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,0.06); flex-shrink: 0; }
.inbox-info { flex: 1; min-width: 0; }
.inbox-name { font-size: 14px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-preview { font-size: 12px; color: var(--text-silver); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.inbox-unread { background: var(--primary); color: #fff; font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 10px; }
.inbox-time { font-size: 10px; color: #555; }

.thread-msg { max-width: 80%; padding: 10px 14px; border-radius: 16px; margin-bottom: 8px; font-size: 14px; line-height: 1.4; }
.thread-msg-own { background: var(--primary); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.thread-msg-their { background: rgba(255,255,255,0.08); color: #fff; margin-right: auto; border-bottom-left-radius: 4px; }
.thread-msg-body { word-break: break-word; }
.thread-msg-link { display: block; margin-top: 6px; font-size: 12px; color: inherit; opacity: 0.8; text-decoration: underline; }
.thread-msg-time { font-size: 10px; opacity: 0.5; margin-top: 4px; text-align: right; }

/* ANALYTICS & DRAFTS */
.analytics-card {
    background: #0a0a0a;
    border: 1px solid #111;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}
.analytics-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
}
.analytics-label {
    font-size: 11px;
    color: #666;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 6px;
    letter-spacing: 1px;
}
.sparkline-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 120px;
}
.sparkline-bar {
    flex: 1;
    background: var(--primary);
    border-radius: 8px 8px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}
.draft-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

/* SEARCH AUTOCOMPLETE */
.rg-search-input-wrap { position: relative; }
.rg-search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(18, 18, 18, 0.98);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    z-index: 3000;
    max-height: 320px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}
.rg-search-suggestions:empty { display: none !important; }
.rg-suggest-section { padding: 8px 0; }
.rg-suggest-section + .rg-suggest-section { border-top: 1px solid var(--border-glass); }
.rg-suggest-label {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-silver);
    padding: 4px 16px 8px;
}
.rg-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: #fff;
}
.rg-suggest-item:hover,
.rg-suggest-item.active {
    background: rgba(255,255,255,0.06);
}
.rg-suggest-item.active { background: rgba(254,44,85,0.12); }
.rg-suggest-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
.rg-suggest-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
}
.rg-suggest-info { flex: 1; min-width: 0; }
.rg-suggest-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rg-suggest-meta {
    font-size: 11px;
    color: var(--text-silver);
    margin-top: 2px;
}
.rg-suggest-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-silver);
}

/* SKELETON SCREENS */
.rg-skeleton-slot {
    width: 100%;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rg-skeleton-media {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #0a0a0a 25%, #111 50%, #0a0a0a 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
.rg-skeleton-meta {
    position: absolute;
    bottom: 80px;
    left: 24px;
    right: 100px;
    z-index: 10;
}
.rg-skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #0a0a0a 25%, #111 50%, #0a0a0a 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
    border-radius: 6px;
    margin-bottom: 10px;
}
.rg-skeleton-line.short { width: 60%; }
.rg-skeleton-line.tiny { width: 40%; height: 10px; }
.rg-skeleton-actions {
    position: absolute;
    right: 24px;
    bottom: 50%;
    transform: translateY(50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    z-index: 10;
}
.rg-skeleton-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(90deg, #0a0a0a 25%, #111 50%, #0a0a0a 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
.rg-skeleton-rect {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(90deg, #0a0a0a 25%, #111 50%, #0a0a0a 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* UTILS */
.hidden { display:none !important; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

/* BOTTOM AD */
.rg-footer-ad { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 2000; display: flex; justify-content: center; align-items: center; pointer-events: auto; background: rgba(0,0,0,0.4); backdrop-filter: blur(5px); }

/* DESKTOP OPTIMIZATIONS (REDGIFS STYLE) */
@media (min-width: 768px) {
    :root { --lane-width: 1000px; --sidebar-width: 280px; }
    
    body, html { overflow: auto; }
    
    .rg-app-wrapper { display: flex; flex-direction: row; height: 100dvh; background: #000; }
    
    /* Sidebar Navigation */
    .rg-nav-bar { 
        position: relative; 
        width: var(--sidebar-width); 
        height: 100vh; 
        flex-direction: column; 
        justify-content: flex-start; 
        padding: 50px 30px; 
        background: #080808; 
        border-radius: 0; 
        border-right: 1px solid var(--border-glass);
        z-index: 1200;
        gap: 8px;
        bottom: auto;
        left: auto;
        right: auto;
    }
    .rg-nav-item { 
        flex-direction: row; 
        width: 100%; 
        padding: 16px 20px; 
        border-radius: 16px; 
        gap: 18px; 
        font-size: 16px; 
        justify-content: flex-start;
        transition: all 0.2s;
        color: rgba(255,255,255,0.4);
        text-decoration: none;
    }
    .rg-nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
    .rg-nav-item.active { background: rgba(254,44,85,0.1); color: var(--primary); }
    .rg-nav-item span { text-transform: none; font-weight: 700; letter-spacing: -0.3px; }
    .rg-nav-upload-pill { width: 36px; height: 36px; border-radius: 12px; margin-bottom: 0; }

    .rg-main-viewport { 
        flex: 1;
        max-width: none;
        height: 100dvh; 
        box-shadow: none;
        display: flex;
        justify-content: center;
        background: #000;
        overflow: hidden;
    }

    .rg-header { 
        display: flex; 
        position: absolute; 
        top: 0; 
        left: 0; 
        right: 0; 
        background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
        pointer-events: none;
        padding: 20px 40px;
    }
    .rg-header * { pointer-events: auto; }

    .rg-niche-bar {
        top: 80px;
        background: rgba(8, 8, 8, 0.9);
        border-bottom: 1px solid var(--border-glass);
        padding: 0 40px;
        height: 60px;
    }

    .rg-feed-container { 
        width: 100%;
        max-width: var(--lane-width);
        display: block; 
        height: 100vh; 
        scroll-snap-type: y mandatory; 
        overflow-y: scroll;
        scroll-behavior: smooth;
        padding-top: 0; /* NO OFFSET */
    }
    
    .rg-video-slot { 
        height: 100vh; 
        width: 100%;
        scroll-snap-align: start; 
        scroll-snap-stop: always;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
        overflow: hidden;
        position: relative;
    }
    
    .sidebar-logo-container { display: block; margin-bottom: 60px; padding-left: 10px; }

    /* SEARCH NICHES */
    .rg-search-niches {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }
    .rg-search-niches .rg-niche-item {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        padding: 8px 16px;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.2s;
    }
    .rg-search-niches .rg-niche-item:hover {
        background: var(--primary);
        border-color: var(--primary);
        transform: translateY(-2px);
    }
    
    .rg-video-element { 
        width: 100%;
        height: 100%;
        object-fit: contain; 
        box-shadow: 0 30px 100px rgba(0,0,0,0.8);
    }
    
    .rg-meta-block { 
        position: absolute; 
        bottom: 80px; 
        left: 40px; 
        right: 120px; 
        z-index: 90;
        pointer-events: auto;
        text-align: left;
    }
    .rg-author { font-size: 24px; color: var(--primary); font-weight: 900; margin-bottom: 6px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
    .rg-desc { font-size: 16px; color: #fff; line-height: 1.5; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }

    .rg-action-stack { 
        position: absolute; 
        right: 30px; 
        bottom: 50%; 
        transform: translateY(50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px; 
        z-index: 100;
    }
    .rg-action-item svg { width: 36px; height: 36px; }
    .rg-action-count { font-size: 14px; color: #fff; font-weight: 800; margin-top: 2px; }
    
    .rg-highlight-lane { height: 100vh; scroll-snap-align: start; }

    /* Compliance Links at Bottom of Sidebar */
    .sidebar-compliance-links {
        margin-top: auto;
        padding: 15px 0 0 10px;
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        border-top: 1px solid rgba(255,255,255,0.05);
    }
    .compliance-link {
        font-size: 10px;
        color: rgba(255,255,255,0.25);
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 500;
        transition: color 0.2s;
        display: block;
    }
    .compliance-link:hover {
        color: var(--primary);
    }

    /* Play Button Overlay - Unified for all platforms */
    .rg-play-btn {
        width: 100px;
        height: 100px;
    }
}
