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

body {
    font-family: 'Optimistic Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: url('./assets/images/background.png') center/cover no-repeat fixed;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    perspective: 1200px; /* Enable 3D perspective */
    cursor: default;
}

body.dragging {
    cursor: grabbing !important;
}

.scene-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

.feed-viewport {
    width: 800px;
    height: 500px;
    background: #ffffff;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.scrollable-feed {
    width: 800px;
    height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: auto; /* Allow native smooth scrolling */
    /* Enhanced smooth scrolling */
    -webkit-overflow-scrolling: touch;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.3) transparent;
    /* Ensure scrolling is not blocked */
    pointer-events: auto;
    position: relative;
    border-radius: 24px;
}

.scrollable-feed::-webkit-scrollbar {
    width: 6px;
}

.scrollable-feed::-webkit-scrollbar-track {
    background: transparent;
}

.scrollable-feed::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
}

.feed-content {
    width: 800px;
    padding: 0;
    min-height: 100%;
    position: relative;
    background: #f0f0f0;
    border-radius: 24px;
}

/* Asset positioning with exact dimensions */
.asset-container {
    position: absolute;
    cursor: pointer;
    overflow: hidden;
    border-radius: 0;
    background: #333;
    z-index: 1;
}

/* Update asset container for grid */
.content-grid .asset-container {
    position: relative;
    background: #333;
    overflow: hidden; /* Ensure content scales within container */
}



/* .asset-container.playing styles removed - no longer needed */

.asset-container.in-view {
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.asset-container:not(.expanded):hover {
    z-index: 10;
}

.asset-container:not(.expanded):hover .asset-video,
.asset-container:not(.expanded):hover .asset-image,
.asset-container:not(.expanded):hover canvas {
    transform: scale(1.1);
}

/* Video styling */
.asset-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
    overflow: hidden;
}

/* Image styling */
.asset-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 0.3s ease;
}

/* Canvas (3D model) styling */
.asset-container canvas {
    width: 100%;
    height: 100%;
    border-radius: 0;
    transition: transform 0.3s ease;
}

/* Section asset styling */
.section-asset {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    cursor: default;
}

.section-asset .asset-image {
    border-radius: 0;
}

/* Disable hover scale for Section 1–3 banners */
.asset-container.section-asset:hover .asset-video,
.asset-container.section-asset:hover .asset-image,
.asset-container.section-asset:hover canvas {
    transform: none !important;
}

/* Flexible masonry layout with absolute positioning */
.content-grid {
    position: relative;
    width: 800px;
    height: 1721px; /* Total height of all rows + gaps */
    background: #e0e0e0;
}

/* Reset grid-based positioning for absolute positioning */
.content-grid .asset-container {
    position: absolute;
}

/* Grid positioning for each asset */

/* Section 1 - Welcome Area - Row 1 */
.section-1-asset {
    top: 0;
    left: 0;
    width: 223px;
    height: 326px;
}

.asset-1 {
    top: 0;
    left: 224px;
    width: 576px;
    height: 326px;
}

/* Section 2 - Main Content Grid */
/* Row 2 */
.asset-2 {
    top: 327px;
    left: 0;
    width: 223px;
    height: 397px; /* Spans rows 2-3 */
}

.asset-3 {
    top: 327px;
    left: 224px;
    width: 352px;
    height: 397px;
}

.asset-4 {
    top: 327px;
    left: 577px;
    width: 223px;
    height: 198px;
}

/* Rows 3-4: Variable columns - [223px][223px][352px] */
.asset-5 {
    top: 526px;
    left: 577px;
    width: 223px;
    height: 397px; /* Spans rows 3-4 */
}

.asset-7 {
    top: 726px;
    left: 0;
    width: 223px;
    height: 198px;
}

.asset-8 {
    top: 726px;
    left: 224px;
    width: 352px;
    height: 198px;
}

/* Section 3 - Apps Section */
/* Row 5 */
.section-2-asset {
    top: 925px;
    left: 0;
    width: 223px;
    height: 198px;
}

.asset-9 {
    top: 925px;
    left: 224px;
    width: 352px;
    height: 198px;
}

.asset-10 {
    top: 925px;
    left: 577px;
    width: 223px;
    height: 198px;
}

/* Row 6 */
.asset-11 {
    top: 1124px;
    left: 0;
    width: 223px;
    height: 198px;
}

.asset-12 {
    top: 1124px;
    left: 224px;
    width: 352px;
    height: 198px;
}

.asset-13 {
    top: 1124px;
    left: 577px;
    width: 223px;
    height: 198px;
}

/* Section 4 - Movies Section */
/* Rows 7-8: Variable columns - [352px][223px][223px] */
.asset-14 {
    top: 1323px;
    left: 0;
    width: 352px;
    height: 198px;
}

.asset-15 {
    top: 1323px;
    left: 353px;
    width: 223px;
    height: 397px; /* Spans rows 7-8 */
}

.section-3-asset {
    top: 1323px;
    left: 577px;
    width: 223px;
    height: 198px;
}

.asset-16 {
    top: 1522px;
    left: 0;
    width: 352px;
    height: 199px;
}

.asset-17 {
    top: 1522px;
    left: 577px;
    width: 223px;
    height: 199px;
}

/* Content overlay */
.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding-left: 20px;
    padding-bottom: 20px;
    padding-top: 12px;
    padding-right: 12px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.1s linear;
}

/* Expanded overlay with different padding */
.video-overlay-expanded {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    color: white;
    padding-left: 32px;
    padding-bottom: 32px;
    padding-top: 20px;
    padding-right: 20px;
    z-index: 11;
    opacity: 0;

    transition: opacity 0.1s linear;
    pointer-events: none;
}

/* Show expanded text only when expanded */
.asset-container.expanded .video-overlay-expanded {
    opacity: 1;
    pointer-events: auto;
}

/* Hide expanded text immediately when collapsing */
.asset-container.collapsing .video-overlay-expanded {
    opacity: 0 !important;
    transition: opacity 0.05s linear; /* Very fast linear fade out */
}

/* Hide feed text only when expanded */
.asset-container.expanded .video-overlay {
    opacity: 0 !important;
}

/* Start fading in feed text during collapse */
.asset-container.collapsing .video-overlay {
    opacity: 1 !important;
    transition: opacity 0.1s linear; /* Faster linear fade in */
}

/* Fix scrim edges in expanded view */
.asset-container.expanded::after,
.asset-container.collapsing::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    z-index: 9;
    pointer-events: none;
}

/* Titles and metadata now handled in expanded overlay */

.asset-container.expanded .asset-video {
    filter: brightness(1) contrast(1) saturate(1.1);
    z-index: 1;
}

/* Feed view text visibility */
.asset-container:not(.expanded):not(.collapsing):hover .video-overlay,
.asset-container:not(.expanded):not(.collapsing).in-view .video-overlay {
    opacity: 1;
}

.video-title {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 4px;
    font-family: 'Optimistic Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* No transition - moves with container only */
}

.asset-1 .video-title {
    font-size: 18px;
    margin-bottom: 6px;
}

.video-meta {
    font-size: 11px;
    font-weight: 400;
    color: #ffffff;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Optimistic Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* No transition - moves with container only */
}

/* Primary CTA button in expanded/full view */
.video-overlay-expanded .primary-cta {
    width: 320px;
    height: 44px;
    border-radius: 100px;
    font-size: 14px;
    font-family: 'Optimistic Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700; /* Optimistic Bold */
    margin-top: 16px; /* spacing from metadata */
    transition: none !important; /* Disable all transitions */
}

.live-indicator {
    background: #ff4757;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 600;
}

/* Avatar info styling */
.avatar-info {
    display: flex;
    align-items: end;
    gap: 8px;
}

.avatar-photo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
    margin-bottom: -4px; /* 16px total bottom spacing (20px container - 4px = 16px) */
}

.avatar-name {
    font-size: 11px;
    font-weight: 400;
    color: #ffffff;
    font-family: 'Optimistic Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-bottom: 0px; /* Uses full 20px container padding for bottom spacing */
    /* No transition - moves with container only */
}

/* App rating styling */
.app-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.star-icon {
    width: 12px;
    height: 12px;
    background: url('./assets/images/star-full.png') center/contain no-repeat;
    /* No transition - moves with container only */
}

.get-button {
    font-size: 11px;
    font-weight: 400;
    color: #ffffff;
    margin-left: 4px;
    font-family: 'Optimistic Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* No transition - moves with container only */
}

/* Event GIF overlay styling for asset-3 */
.event-gif-overlay {
    position: absolute;
    width: 250px;
    height: auto;
    z-index: 15; /* Above video overlay */
    pointer-events: none; /* Allow clicks to pass through */
    transition: width 0.3s ease, transform 0.3s ease, top 0.3s ease;
    /* Add initial state for better animation */
    opacity: 1;
}

/* Center the GIF in normal view */
.asset-3 .event-gif-overlay {
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    max-width: 100%; /* Ensure it doesn't overflow the container */
}

/* Expanded view - 400px width and top: 40% */
.asset-3.expanded .event-gif-overlay {
    width: 300px;
    top: 45%;
    /* Much stronger depth effects */
    filter: 
        drop-shadow(0 30px 60px rgba(0, 0, 0, 0.8)) 
        drop-shadow(0 15px 30px rgba(0, 0, 0, 0.6))
        drop-shadow(0 5px 15px rgba(255, 255, 255, 0.1)); /* subtle highlight */
    transform: translate(-50%, -50%) perspective(800px) rotateX(15deg) rotateY(-5deg) scale(1.15) translateZ(100px);
    /* Enable smooth transitions */
    transition: transform 0.15s ease-out;
}

/* Animation removed - direct positioning is used */

/* Ensure GIF scales with hover effect */
.asset-3:not(.expanded):hover .event-gif-overlay {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Add stronger blur to background image when expanded for depth */
.asset-3.expanded .asset-image {
    filter: blur(5px) brightness(0.7) saturate(0.8);
    transition: filter 0.5s ease;
    transform: scale(1.05); /* Slight zoom to enhance depth */
}

/* Expanded view styling is handled in the main rule above */

/* Parallax effect on scroll for expanded asset-3 */
.asset-3.expanded {
    transform-style: preserve-3d;
}


/* Loading state */
.asset-container.loading {
    background: linear-gradient(45deg, #333, #555);
    background-size: 200% 200%;
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 3D Controls */
.controls-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    max-width: 300px;
    display: none; /* Temporarily hidden */
}

.playback-mode-controls button {
    padding: 6px 12px;
    margin: 2px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.playback-mode-controls button:hover {
    background: #333;
    border-color: #00ff88;
}

.playback-mode-controls button.active {
    background: #00ff88;
    color: #000;
    border-color: #00ff88;
    font-weight: bold;
}


/* Drag zone hint */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body:hover::before {
    opacity: 0.1;
    background: radial-gradient(circle at center, transparent 400px, rgba(255,255,255,0.1) 400px);
}

/* Fullscreen Overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-overlay.active {
    display: flex;
    opacity: 1;
}

.fullscreen-video-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.fullscreen-video {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.fullscreen-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 18px;
    padding: 12px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-button:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2001;
}

.close-button:hover {
    background: rgba(255,255,255,0.3);
}

/* Close button for expanded videos */
.expanded-close-button {
    position: absolute !important;
    top: 32px !important;
    right: 32px !important;
    background: #ffffff !important;
    border: none !important;
    color: #000000 !important;
    font-size: 24px !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    opacity: 0;
    transition: all 0.3s ease;
    transform: scale(0.8);
    pointer-events: none;
}

.asset-container.expanded .expanded-close-button {
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.expanded-close-button:hover {
    background: rgba(255,255,255,0.9) !important;
    transform: scale(1.1) !important;
    cursor: pointer !important;
}

/* UFI (heart/share/save) stack - expanded view */
.ufi-stack {
    position: absolute;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    z-index: 60;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ufi-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ufi-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px; /* icon size */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
    cursor: pointer;
}

.ufi-button:focus { outline: none; }
.ufi-button:hover { transform: scale(1.05); }

.ufi-heart { background-image: url('./assets/images/heart-on.png'); }
.ufi-heart.active { background-image: url('./assets/images/heart-on.png'); }
.ufi-share { background-image: url('./assets/images/share.png'); }
.ufi-save { background-image: url('./assets/images/save.png'); }
.ufi-save.active { opacity: 1; }

.ufi-count {
    margin-top: 4px; /* spacing between icon and text */
    font-size: 14px;
    font-weight: 500; /* Optimistic Medium */
    font-family: 'Optimistic Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Show UFI only in expanded view */
.asset-container.expanded .ufi-stack {
    opacity: 1;
    pointer-events: auto;
}

.asset-container.collapsing .ufi-stack {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Backdrop for expanded video */
.expansion-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.25s ease-out;
    pointer-events: none;
}

.expansion-backdrop.active {
    opacity: 1;
    pointer-events: none;
}

/* Ensure expanded video is bright and clear */
.asset-container.expanded {
    box-shadow:
        0 20px 40px rgba(0,0,0,0.5),
        0 0 0 2px rgba(255,255,255,0.1),
        0 0 30px rgba(255,255,255,0.05);
    filter: brightness(1.05) contrast(1.02) saturate(1.05);
    pointer-events: auto !important;
}

/* Heart Animation System */
.heart-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1500;
}

/* Global heart container - hidden by default */
#heartContainer {
    display: none;
}

/* Heart container within expanded assets */
.asset-container.expanded .panel-heart-container {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

/* Profile photos container for expanded view */
.profile-likes-container {
    position: absolute;
    bottom: 135px; /* raised to clear CTA (44px height + 16px gap) */
    left: 15px;
    z-index: 60;
    width: 200px;
    height: 70px;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: visible;
}

.asset-container.expanded .profile-likes-container {
    opacity: 1;
    left: 32px;
}

/* Hide profile photos during collapse */
.asset-container.collapsing .profile-likes-container {
    opacity: 0;
}

/* Individual profile photo wrapper */
.profile-photo-wrapper {
    position: absolute;
    left: var(--pos-x, 0);
    bottom: var(--pos-y, 0);
    animation: profilePopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: var(--delay);
    opacity: 0;
    transform: scale(0.5);
    z-index: var(--z-index, 1);
}

@keyframes profilePopIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Profile photo styling */
.profile-photo {
    width: var(--photo-size, 32px);
    height: var(--photo-size, 32px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background-color: #333;
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-photo:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Heart indicator on profile */
.profile-heart-badge {
    position: absolute;
    top: var(--badge-top, -5px);
    left: var(--badge-left, auto);
    right: var(--badge-right, -5px);
    width: var(--badge-size, 14px);
    height: var(--badge-size, 14px);
    background: url('./assets/images/heart.png') center/contain no-repeat;
    animation: heartBadgePulse 1.8s ease-in-out infinite;
    z-index: 10;
    transform: rotate(var(--badge-rotation, 0deg));
    opacity: 0.95;
}

@keyframes heartBadgePulse {
    0%, 100% {
        transform: rotate(var(--badge-rotation, 0deg)) scale(1);
    }
    50% {
        transform: rotate(var(--badge-rotation, 0deg)) scale(1.15);
    }
}


/* Floating animation for profiles after they appear */
.profile-photo-wrapper.floating {
    opacity: 1;
    transform: scale(1);
    animation: floatProfile 4s ease-in-out infinite;
    animation-delay: var(--float-delay);
}

@keyframes floatProfile {
    0%, 100% {
        transform: scale(1) translateY(0) translateX(0);
    }
    33% {
        transform: scale(1) translateY(-6px) translateX(2px);
    }
    66% {
        transform: scale(1) translateY(-3px) translateX(-2px);
    }
}

.heart {
    position: absolute;
    font-size: 32px;
    color: #ff4757;
    animation: heartFloat 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(255, 71, 87, 0.5);
}

.heart.curve-left {
    animation: heartFloatLeft 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.heart.curve-right {
    animation: heartFloatRight 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes heartFloat {
    0% {
        transform: translateY(0) translateX(0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) translateX(30px) scale(1.5) rotate(10deg);
        opacity: 0;
    }
}

@keyframes heartFloatLeft {
    0% {
        transform: translateY(0) translateX(0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) translateX(-40px) scale(1.5) rotate(-15deg);
        opacity: 0;
    }
}

@keyframes heartFloatRight {
    0% {
        transform: translateY(0) translateX(0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) translateX(50px) scale(1.5) rotate(20deg);
        opacity: 0;
    }
}

.fullscreen-title {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.fullscreen-meta {
    position: absolute;
    top: 60px;
    left: 20px;
    color: white;
    font-size: 14px;
    opacity: 0.9;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* 3D Model Modal Styles removed */

/* All assets now use standard hover effects - no special 3D model styling */

/* Minimal FBX modal overlay */
.fbx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.fbx-modal-overlay.active {
    display: flex;
}

.fbx-modal-content {
    position: relative;
    width: 80vw;
    height: 80vh;
    max-width: 1200px;
    max-height: 800px;
    background: #111;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    overflow: hidden;
}

.fbx-modal-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.fbx-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #ffffff;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
}

.fbx-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Feed Controls */
.feed-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 800px;
    height: 500px;
    pointer-events: none;
    z-index: 1000;
    border-radius: 24px; /* Match the scrollable-feed border radius */
}

/* Search Control */
.search-control {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.search-control:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Immersive View Control */
.immersive-control {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.immersive-control:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Control Icon Styling */
.control-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
}

/* Immersive overlay stage (full-viewport, non-blocking) */
.immersive-stage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: auto; /* capture scroll events */
    z-index: 1100; /* above feed controls, below modal(3000) */
    overflow: visible;
    perspective: 800px; /* Stronger perspective for more dramatic 3D (was 1200px) */
    perspective-origin: 50% 50%;
    /* Improve compositing stability */
    contain: layout paint style;
    will-change: transform;
}

/* Dimming backdrop behind pop-outs */
.immersive-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75); /* Darker backdrop to hide any flicker */
    z-index: 1090; /* below immersive-stage, above feed */
    pointer-events: auto; /* capture scroll events */
    opacity: 0;
    transition: opacity 0.25s ease-out; /* Faster to match feed fade-out */
    /* Force GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Improve compositing stability */
    contain: paint;
    will-change: opacity;
}

.immersive-backdrop.active {
    opacity: 1;
}

/* Match enter animation timing for consistency */
.immersive-backdrop:not(.active) {
    transition: opacity 0.25s ease-out; /* Same as fade-in */
}

/* Individual pop-out cards */
.immersive-card {
    position: absolute;
    will-change: transform, box-shadow;
    transform-origin: center;
    overflow: visible;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
    /* Only transition the transform for depth effects, not position */
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
    transform-style: preserve-3d;
    cursor: pointer;
}

/* Hover animation for immersive cards */
.immersive-card:hover {
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    z-index: 10; /* Bring to front on hover */
}

/* Scale the inner content on hover instead */
.immersive-card:hover img,
.immersive-card:hover video {
    transform: scale(1.05);
    transition: transform 0.2s ease-out;
}

/* Scale event gif overlay too */
.immersive-card:hover .event-gif-overlay {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Initial state for entrance animation */
.immersive-card.immersive-card-initial {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.6s ease-out,
                opacity 0.3s ease-out,
                border-radius 0.4s ease-out,
                left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0.8;
    border-radius: 0; /* Start with sharp corners like feed panels */
}

/* Initial state for gif overlay */
.immersive-card.immersive-card-initial .event-gif-overlay {
    opacity: 0.8; /* Match card opacity */
}

/* Exit state for departure animation - EXACT same timing as enter */
.immersive-card.immersive-card-exiting {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.6s ease-out,
                opacity 0.3s ease-out,
                border-radius 0.4s ease-out,
                left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0; /* Go directly to 0, not 0.2 */
}

/* Ensure children follow exit animation */
.immersive-card.immersive-card-exiting img,
.immersive-card.immersive-card-exiting video,
.immersive-card.immersive-card-exiting::after,
.immersive-card.immersive-card-exiting .event-gif-overlay {
    transition: border-radius 0.4s ease-out;
}

/* Event GIF overlay in immersive cards */
.immersive-card .event-gif-overlay {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 70%; /* Scale relative to card size */
    max-width: 250px;
    height: auto;
    z-index: 15;
    pointer-events: none;
    opacity: 1;
    transition: all 0.4s ease-out, transform 0.2s ease-out;
    /* Add depth effect */
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

.immersive-card img,
.immersive-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit; /* Match parent's border-radius */
    display: block;
    transition: border-radius 0.4s ease-out, transform 0.2s ease-out;
    transform: scale(1); /* Default scale for smooth hover transition */
}

/* Ensure section assets also have rounded corners in immersive mode */
.immersive-card.section-1-asset img,
.immersive-card.section-2-asset img,
.immersive-card.section-3-asset img,
.immersive-card.section-asset img {
    border-radius: 16px !important;
}

/* Subtle vignette to emphasize depth - removed for cleaner look */
.immersive-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit; /* Match parent's border-radius */
    /* Removed box-shadow to eliminate grey shade */
    pointer-events: none;
    transition: border-radius 0.4s ease-out;
}

/* Hide the 800x500 panel visuals while keeping scroll functional */
.scrollable-feed.immersive-mode {
    opacity: 0;
    transition: opacity 0.15s ease-out; /* Faster fade-out */
    /* Ensure scrolling still works */
    pointer-events: none;
    /* Force GPU acceleration to prevent flicker */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Smooth fade-in when exiting immersive mode */
.scrollable-feed:not(.immersive-mode) {
    transition: opacity 0.15s ease-out; /* Same easing as enter */
    pointer-events: auto; /* Re-enable interactions */
}

.feed-viewport.immersive-mode {
    background: transparent;
    box-shadow: none;
    /* Allow scrolling to pass through to the feed */
    pointer-events: none;
}

/* Immediate restoration when exiting immersive mode */
.feed-viewport:not(.immersive-mode) {
    transition: background 0.2s ease-out, box-shadow 0.2s ease-out; /* Same easing as enter */
}

/* But keep controls clickable */
.feed-viewport.immersive-mode .feed-controls {
    pointer-events: auto;
}

/* Keep immersive control visible and clickable */
.feed-viewport.immersive-mode .immersive-control {
    opacity: 1;
    pointer-events: auto;
}

/* Feed controls when relocated outside panel in immersive mode */
.feed-controls.immersive-relocated {
    position: fixed !important;
    top: 50% !important;
    left: auto; /* Will be set dynamically via JS */
    right: 40px; /* Fallback position */
    transform: translateY(-50%) !important;
    width: auto !important;
    height: auto !important;
    z-index: 1500 !important; /* Above immersive stage */
    pointer-events: auto !important;
    display: flex;
    flex-direction: column;
    gap: 44px; /* Increased gap between icons */
    align-items: center;
    /* Smooth transition when relocating */
    transition: all 0.3s ease-out;
    /* Prevent border-radius from affecting controls container */
    border-radius: 0 !important;
    /* Fade in animation */
    animation: fadeInControls 0.4s ease-out;
}

@keyframes fadeInControls {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* Keep controls unstyled in immersive mode - only position matters */
.feed-controls.immersive-relocated .immersive-control,
.feed-controls.immersive-relocated .search-control {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
}

/* Adjust icon size in immersive mode */
.feed-controls.immersive-relocated .control-icon {
    width: 44px;
    height: 44px;
}

/* Remove backgrounds during immersive mode to prevent flicker */
.immersive-mode .feed-content,
.immersive-mode .content-grid {
    background: transparent !important;
}
