:root {
            --gold-primary: #FFD700;
            --glass-bg: rgba(255, 255, 255, 0.1);
            --glass-border: rgba(255, 255, 255, 0.15);
            --glass-blur: blur(10px);
        }
        
        * {
            box-sizing: border-box;
        }

        body.reels-page {
            background-color: #050505;
            overflow: hidden;
            color: #fff;
            font-family: 'Urbanist', sans-serif;
            margin: 0;
        }
        
        /* Header */
body.reels-page header {
            position: fixed;
            top: 0;
            width: 100%;
            z-index: 100;
            background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
            padding: 20px 0;
            pointer-events: none;
        }
        body.reels-page header .container {
            pointer-events: auto;
        }

        /* Ambient Background (Desktop) */
        .ambient-bg {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            z-index: 0;
            opacity: 0.3;
            filter: blur(80px);
            background: radial-gradient(circle at 50% 50%, #222, #000);
            transition: background 1s ease;
        }

        .reels-container {
            height: 100vh; /* Fallback */
            height: 100dvh; /* Dynamic viewport height for mobile browsers */
            width: 100%;
            overflow-y: scroll;
            scroll-snap-type: y mandatory;
            scroll-behavior: smooth;
            position: relative;
            z-index: 1;
        }

        .reel-item {
            height: 100vh;
            height: 100dvh;
            width: 100%;
            scroll-snap-align: start;
            scroll-snap-stop: always;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        /* Desktop "Phone Frame" Wrapper */
        .video-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #000;
            overflow: hidden;
        }

        @media (min-width: 768px) {
            .video-wrapper {
                width: auto; /* Let ratio decide width */
                height: auto;
                aspect-ratio: 9/16; 
                max-width: 100%;
                max-height: 85vh; /* Limit height */
                border-radius: 20px;
                box-shadow: 0 20px 50px rgba(0,0,0,0.8);
                border: 1px solid var(--glass-border);
            }
        }

        video {
            width: 100%;
            height: 100%;
            object-fit: cover; 
            display: block;
        }
        
        @media (max-width: 768px) {
             /* Mobile strict fit */
             .video-wrapper {
                 height: 100dvh;
                 width: 100vw;
             }
             video {
                 height: 100%;
                 width: 100%;
                 object-fit: cover;
             }
        }

        @media (min-width: 768px) {
             video {
                 border-radius: 20px;
             }
        }

        /* Loading Spinner */
        .spinner-overlay {
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            display: none;
            z-index: 5;
        }
        .reel-item.loading .spinner-overlay { display: block; }
        
        .custom-loader {
            width: 50px;
            height: 50px;
            border: 4px solid rgba(255, 215, 0, 0.3);
            border-radius: 50%;
            border-top-color: var(--gold-primary);
            animation: spin 1s linear infinite;
        }
        @keyframes spin { 100% { transform: rotate(360deg); } }

        /* UI Overlays */
        .reel-ui {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            pointer-events: none; /* Let clicks pass to video click area */
        }
        
        .reel-bottom-gradient {
            position: absolute;
            bottom: 0; left: 0; width: 100%; height: 50%;
            background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
            pointer-events: none;
        }

        /* Info Section */
        .reel-info {
            position: absolute;
            bottom: 30px; /* Space for progress bar */
            left: 20px;
            right: 80px;
            pointer-events: auto;
            z-index: 10;
        }
        
        .reel-avatar {
            width: 44px; height: 44px;
            border-radius: 50%;
            margin-right: 12px;
            float: left;
            position: relative;
            z-index: 1;
            /* Flex center for img */
            display: flex;
            align-items: center;
            justify-content: center;
            background: #000; /* Fallback bg */
        }
        
        /* Rotating Border Effect - Simplified */
        .reel-avatar::before {
            content: '';
            position: absolute;
            top: -4px; left: -4px; /* Slightly larger than border */
            right: -4px; bottom: -4px;
            border-radius: 50%;
            background: conic-gradient(from 0deg, var(--gold-primary), transparent, var(--gold-primary));
            z-index: -1;
            animation: rotate-border 2s linear infinite;
        }
        
        /* Inner black background to hide center of gradient (behind image) */
        .reel-avatar::after {
            content: '';
            position: absolute;
            top: -2px; left: -2px;
            right: -2px; bottom: -2px;
            border-radius: 50%;
            background: #000;
            z-index: -1;
        }

        @keyframes rotate-border {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        .username {
            font-weight: 700;
            font-size: 16px;
            color: #fff;
            display: block;
            margin-bottom: 4px;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }
        .username i { color: var(--gold-primary); font-size: 12px; margin-left: 4px; }
        
        .caption {
            font-size: 14px;
            color: #ddd;
            line-height: 1.4;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
            max-width: 100%;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* Action Buttons */
        .reel-actions {
            position: absolute;
            bottom: 40px;
            right: 15px;
            z-index: 10;
            display: flex;
            flex-direction: column;
            gap: 25px;
            align-items: center;
            pointer-events: auto;
        }

        .action-item {
            text-align: center;
        }
        
        .action-btn {
            width: 44px; height: 44px;
            border-radius: 50%;
            background: var(--glass-bg);
            backdrop-filter: var(--glass-blur);
            border: 1px solid var(--glass-border);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: #fff;
            transition: all 0.2s;
            cursor: pointer;
            margin-bottom: 5px;
        }
        
        .action-btn:hover {
            background: rgba(255,255,255,0.2);
            transform: scale(1.1);
        }
        
        .action-btn.active {
            color: #ff4757;
            background: rgba(255, 71, 87, 0.2);
            border-color: rgba(255, 71, 87, 0.4);
        }

        .action-label {
            font-size: 11px;
            font-weight: 600;
            color: #fff;
            text-shadow: 0 1px 2px rgba(0,0,0,0.8);
        }

        /* Controls */
        .nav-btn {
            position: fixed;
            right: 40px;
            top: 50%;
            transform: translateY(-50%);
            width: 50px; height: 50px;
            border-radius: 50%;
            background: rgba(255,255,255,0.1);
            color: #fff;
            border: 1px solid rgba(255,255,255,0.1);
            z-index: 50;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: 0.2s;
        }
        .nav-btn.prev { transform: translateY(-120%); }
        .nav-btn:hover { background: rgba(255,215,0,0.2); color: var(--gold-primary); }
        
        @media (max-width: 1200px) { .nav-btn { display: none; } }

        /* Mute Button logic moved to .reel-actions */

        /* Play Overlay */
        .play-icon {
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%) scale(1.5);
            font-size: 50px;
            color: rgba(255,255,255,0.8);
            pointer-events: none;
            opacity: 0;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            z-index: 4;
            filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
        }
        .reel-item.paused .play-icon { opacity: 1; transform: translate(-50%, -50%) scale(1); }

        /* Progress Bar */
        .progress-container {
            position: absolute;
            bottom: 0; left: 0;
            width: 100%;
            height: 4px;
            background: rgba(255,255,255,0.2);
            cursor: pointer;
            z-index: 15;
            pointer-events: auto;
            transition: height 0.2s;
        }
        .progress-container:hover { height: 8px; }
        
        .progress-bar {
            height: 100%;
            background: var(--gold-primary);
            width: 0%;
            border-radius: 0 2px 2px 0;
            position: relative;
        }
