/* Base Styles */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: black;
    font-family: Arial, sans-serif;
}

/* YouTube player base styles */
#youtube-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

#youtube-player.disabled-controls {
    pointer-events: none;
}

#youtube-player.disabled-controls iframe {
    pointer-events: none;
}

/* Video cover for inventory mode */
.video-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-cover.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Play Button Overlay Styles */
#playButtonOverlay {
    transition: opacity 0.3s ease;
}

#playButtonOverlay .play-button {
    position: relative;
    z-index: 1002;
}

#playButtonOverlay .play-button:hover {
    transform: scale(1.1) !important;
    background: rgba(255, 255, 255, 1) !important;
}

#playButtonOverlay .play-button:active {
    transform: scale(0.95) !important;
}

/* Ensure play button is above other elements */
#playButtonOverlay svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Hide play button overlay in inventory mode */
.inventory-overlay.visible ~ #playButtonOverlay {
    display: none !important;
}

/* Hide play button overlay when viewing items */
.channel-avatar-container.item-viewing ~ #playButtonOverlay {
    display: none !important;
}

/* Responsive adjustments for different screen sizes */
@media (max-width: 480px) {
    #playButtonOverlay .play-button {
        width: 70px !important;
        height: 70px !important;
    }

    #playButtonOverlay .play-button svg {
        width: 28px !important;
        height: 28px !important;
    }
}

@media (min-width: 1200px) {
    #playButtonOverlay .play-button {
        width: 120px !important;
        height: 120px !important;
    }

    #playButtonOverlay .play-button svg {
        width: 48px !important;
        height: 48px !important;
    }
}

/* Ensure smooth fade out animation */
#playButtonOverlay[style*="opacity: 0"] {
    pointer-events: none;
}

/* Universal Modal System - Updated for borderless, full-screen content with horizontal scroll */
.universal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.universal-modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: none;
    border-radius: 0;
    max-width: 98vw;
    max-height: 98vh;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
}

/* Make modal content even larger for images */
.modal-content.image-modal {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    transform: none;
}

/* Horizontal scroll container for multiple items */
.modal-scroll-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.modal-scroll-container::-webkit-scrollbar {
    display: none;
}

.modal-scroll-container {
    scrollbar-width: none;
}

.modal-scroll-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Single item modal (no scroll) */
.modal-content.single-item .modal-scroll-container {
    overflow: hidden;
}

.modal-header {
    display: none;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: bold;
    flex: 1;
}

.modal-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Special styling for image modal body */
.modal-body.image-body {
    padding: 0;
    min-height: auto;
}

/* Special styling for text modal body */
.modal-body.text-body {
    padding: 0 20px;
    justify-content: flex-start;
    align-items: stretch;
    cursor: pointer;
}

/* Make sure text content doesn't inherit cursor */
.modal-body.text-body .modal-text-content {
    cursor: default;
}

/* Clickable exit areas for text modals */
.text-exit-area {
    flex-shrink: 0;
    width: 100%;
    cursor: pointer;
    background: transparent;
}

.text-exit-area.top {
    height: 100px;
}

.text-exit-area.bottom {
    height: 100px;
}

.text-exit-area:hover {
    background: rgba(255, 255, 255, 0.02);
}

.modal-body img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: none;
}

/* For full-screen image modals */
.modal-body.image-body img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
}

.modal-navigation {
    display: none;
}

.modal-navigation.hidden {
    display: none;
}

/* New fixed corner navigation */
.modal-nav-corners {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1001;
}

.nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #888888;
    width: 60px;
    height: 60px;
    font-size: 32px;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: auto;
    border-radius: 0;
}

.nav-btn.prev {
    left: 20px;
}

.nav-btn.next {
    right: 20px;
}

.nav-btn:hover {
    color: #bbbbbb;
    transform: translateY(-50%) scale(1.1);
}

.nav-btn:active {
    transform: translateY(-50%) scale(0.95);
    color: #666666;
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Hide specific navigation buttons when they shouldn't be shown */
.nav-btn.hidden {
    display: none;
}

/* Modal content types - updated for borderless display */
.modal-text-content {
    color: white;
    line-height: 1.6;
    text-align: justify;
    font-size: 16px;
    max-width: 800px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
    padding: 20px;
    margin: 20px 0;
    flex-shrink: 0;
    align-self: center;
}

/* Force white color on ALL nested elements in modal text content */
.modal-text-content * {
    color: white !important;
}

.modal-pdf-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: white;
    padding: 0;
    position: relative;
}

.modal-pdf-cover {
    max-width: 300px;
    max-height: 400px;
    box-shadow: none;
    position: relative;
    cursor: pointer;
    /* Animated border using box-shadow */
    animation: borderLights 3s linear infinite;
    border: 3px solid transparent;
}

@keyframes borderLights {
    0% {
        box-shadow: 
            0 0 10px 2px rgba(255, 255, 255, 0.8),
            10px 0 10px 2px rgba(255, 255, 255, 0),
            0 10px 10px 2px rgba(255, 255, 255, 0),
            -10px 0 10px 2px rgba(255, 255, 255, 0),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
    25% {
        box-shadow: 
            0 0 10px 2px rgba(255, 255, 255, 0),
            10px 0 10px 2px rgba(255, 255, 255, 0.8),
            0 10px 10px 2px rgba(255, 255, 255, 0),
            -10px 0 10px 2px rgba(255, 255, 255, 0),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
    50% {
        box-shadow: 
            0 0 10px 2px rgba(255, 255, 255, 0),
            10px 0 10px 2px rgba(255, 255, 255, 0),
            0 10px 10px 2px rgba(255, 255, 255, 0.8),
            -10px 0 10px 2px rgba(255, 255, 255, 0),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
    75% {
        box-shadow: 
            0 0 10px 2px rgba(255, 255, 255, 0),
            10px 0 10px 2px rgba(255, 255, 255, 0),
            0 10px 10px 2px rgba(255, 255, 255, 0),
            -10px 0 10px 2px rgba(255, 255, 255, 0.8),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
    100% {
        box-shadow: 
            0 0 10px 2px rgba(255, 255, 255, 0.8),
            10px 0 10px 2px rgba(255, 255, 255, 0),
            0 10px 10px 2px rgba(255, 255, 255, 0),
            -10px 0 10px 2px rgba(255, 255, 255, 0),
            0 -10px 10px 2px rgba(255, 255, 255, 0);
    }
}

.modal-pdf-label {
    position: absolute;
    right: -60px;
    bottom: 10px;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-pdf-actions {
    display: none; /* Hide the Open PDF button */
}

.open-pdf-btn {
    background: red;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.open-pdf-btn:hover {
    background: darkred;
}

.modal-image-content {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Image itself should not show pointer cursor */
.modal-image-content img {
    cursor: default;
}

.modal-image-info {
    color: white;
    margin-top: 15px;
    font-size: 14px;
    opacity: 0.9;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 4px;
}

/* UPDATED: Hide modal in landscape mode - ONLY ON MOBILE DEVICES */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .universal-modal {
        display: none !important;
    }

    .modal-nav-corners {
        display: none !important;
    }
}

/* Channel Index Overlay - now shows channel grid in normal mode */
.channel-index-overlay {
    position: fixed;
    top: 80px;
    left: 20px;
    right: 20px;
    bottom: 120px;
    background: transparent;
    z-index: 240;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.channel-index-overlay.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Channel Index Header */
.channel-index-header {
    color: white;
    font-size: 120px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    text-align: center;
    padding: 0;
    margin: 0;
    line-height: 1;
    z-index: 3;
    pointer-events: none;
    flex-shrink: 0;
}

/* Channel Index backdrop - full clickable area behind content */
.channel-index-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    cursor: pointer;
}

/* Channel Index content area - grid layout */
.channel-index-content {
    flex: 1;
    color: red;
    font-size: 14px;
    line-height: 1.6;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 15px;
    align-content: center;
    justify-items: center;
    padding: 10px 20px 20px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: red transparent;
    position: relative;
    z-index: 2;
}

/* Adjust grid for fewer items */
.channel-index-content.few-items {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    justify-content: center;
}

.channel-index-content::-webkit-scrollbar {
    width: 6px;
}

.channel-index-content::-webkit-scrollbar-track {
    background: transparent;
}

.channel-index-content::-webkit-scrollbar-thumb {
    background: red;
    border-radius: 3px;
}

/* Channel item styling for grid */
.channel-index-item-grid {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    width: 60px;
    height: auto;
    position: relative;
    z-index: 3;
}

.channel-index-item-grid:hover {
    transform: scale(1.1);
}

.channel-index-item-grid:active {
    transform: scale(0.95);
}

.channel-index-grid-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid red;
    margin-bottom: 4px;
}

.channel-index-grid-avatar.global-channel {
    border: 2px solid gold;
}

.channel-index-grid-title {
    font-size: 7px;
    font-weight: bold;
    color: white;
    line-height: 1.1;
    max-width: 60px;
    word-wrap: break-word;
    text-align: center;
}

/* Current channel highlighting */
.channel-index-item-grid.current .channel-index-grid-title {
    color: red;
    font-weight: bold;
}

.channel-index-item-grid.current .channel-index-grid-avatar {
    border: 2px solid red;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* UPDATED: Hide channel index in landscape mode - ONLY ON MOBILE DEVICES */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .channel-index-overlay {
        display: none !important;
    }
}

/* Loading */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    z-index: 50;
    display: none; 
}

/* Channel avatar styles */
.channel-avatar {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid red;
    z-index: 250;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.channel-avatar.blog-mode {
    top: 120px;
    left: 20px;
    right: auto;
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

.antenna-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: red;
    border-radius: 50%;
    top: -20px;
    z-index: 251;
    transition: opacity 0.3s ease;
}

.antenna-dot.left {
    left: 10px;
}

.antenna-dot.right {
    right: 10px;
}

.antenna-dot.hidden {
    opacity: 0;
}

.antenna-dot.item-viewing {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.channel-avatar-container.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Hide avatar and antenna dots when in folder mode */
.channel-avatar-container.folder-mode .channel-avatar {
    opacity: 0;
    pointer-events: none;
}

.channel-avatar-container.folder-mode .antenna-dot {
    opacity: 0;
    pointer-events: none;
}

.age-daily.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.typo-controls.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.channel-avatar-container {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    z-index: 250;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.channel-avatar-container.blog-mode {
    top: 120px;
    left: 20px;
    right: auto;
    width: 50px;
    height: 50px;
}

.channel-avatar-container:active {
    transform: scale(0.9);
}

.channel-avatar-container::before,
.channel-avatar-container::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 15px;
    background: red;
    top: -15px;
    transition: opacity 0.3s ease;
}

.channel-avatar-container::before {
    left: 15px;
    transform: rotate(-20deg);
}

.channel-avatar-container::after {
    right: 15px;
    transform: rotate(20deg);
}

.channel-avatar-container.blog-mode::before,
.channel-avatar-container.blog-mode::after {
    opacity: 0;
}

/* Global channel special styling */
.channel-avatar-container.global-channel {
    border: 3px solid gold;
}

.channel-avatar-container.global-channel .channel-avatar {
    border: 3px solid gold;
}

.channel-avatar-container.global-channel::before,
.channel-avatar-container.global-channel::after {
    background: gold;
}

/* Channel info display */
.channel-info-display {
    position: fixed;
    bottom: 55px;
    right: 20px;
    color: white;
    font-size: 18px;
    text-align: right;
    z-index: 200;
    line-height: 1.4;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Container doesn't catch events */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.channel-info-display.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Channel source info (via ChannelName) */
.channel-info-source {
    font-size: 14px;
    margin-bottom: 2px;
    opacity: 0.9;
    pointer-events: auto; /* Enable clicks on source */
    cursor: pointer;
}

.channel-info-source span {
    pointer-events: auto;
}

.channel-info-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.channel-info-location {
    font-size: 16px;
    opacity: 0.8;
}

/* Container for links - stacks vertically on mobile, horizontal on desktop */
.channel-info-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-top: 4px;
}

/* Global channel info styling */
.channel-info-display.global-channel .channel-info-name {
    color: gold;
}

/* Channel preview styles */
.channel-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 50;
    opacity: 0;
    transform: translateY(100%);
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.channel-preview.from-top {
    transform: translateY(-100%);
}

.channel-preview-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 6px solid red;
    margin-bottom: 30px;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.3);
}

.channel-preview-info {
    color: red;
    font-size: 18px;
    text-align: center;
    max-width: 300px;
}

.channel-preview-info h1 {
    margin: 0 0 15px 0;
    font-size: 32px;
    text-decoration: underline;
}

.channel-preview-info .bio {
    font-size: 16px;
    line-height: 1.4;
}

.channel-preview-info a {
    color: red;
    text-decoration: underline;
}

/* Global channel preview styling */
.channel-preview.global .channel-preview-avatar {
    border: 6px solid gold;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
}

.channel-preview.global .channel-preview-info {
    color: gold;
}

.channel-preview.global .channel-preview-info a {
    color: gold;
}

/* Inventory overlay */
.inventory-overlay {
    position: fixed;
    top: 80px;
    left: 20px;
    right: 20px;
    bottom: 120px;
    background: transparent;
    z-index: 240;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    overflow: hidden;
    display: flex;
}

.inventory-overlay.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Inventory backdrop - full clickable area behind content */
.inventory-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
    cursor: pointer;
}

/* Main inventory content area - 4 columns by default */
.inventory-content {
    flex: 1;
    height: 100%;
    color: red;
    font-size: 14px;
    line-height: 1.6;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(100px, auto);
    gap: 15px;
    align-content: start; /* Changed from center to start */
    justify-items: center;
    padding: 20px 20px 80px 20px; /* Extra bottom padding for last row and episode labels */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: red transparent;
    position: relative;
    z-index: 2;
}

/* Center alignment for few items (8 or less) */
.inventory-content.few-items {
    align-content: center;
}

/* Start alignment for medium items (9-16) to ensure scroll to top */
.inventory-content.medium-items {
    align-content: start;
}

/* First item starts in column 2 to avoid avatar/back button */
.inventory-content .inventory-item:nth-child(1) {
    grid-column: 2;
}

/* Second item in column 3 */
.inventory-content .inventory-item:nth-child(2) {
    grid-column: 3;
}

/* Third item in column 4 */
.inventory-content .inventory-item:nth-child(3) {
    grid-column: 4;
}

/* Fourth item onwards flow normally starting from column 1 of row 2 */
.inventory-content .inventory-item:nth-child(n+4) {
    grid-column: auto;
}

/* Single item should span all columns and be centered */
.inventory-content.single-item {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Reset first item positioning for single item view */
.inventory-content.single-item .inventory-item:nth-child(1) {
    grid-column: auto;
}

/* Single video items should have constrained size like folder items */
.inventory-content.single-item .inventory-item.video-item {
    width: auto;
    max-width: 400px; /* Reasonable max width for single video */
    height: auto;
}

/* Desktop: larger single video */
@media screen and (min-width: 1025px) {
    .inventory-content.single-item .inventory-item.video-item {
        max-width: 500px;
    }
}

/* Mobile: smaller single video */
@media screen and (max-width: 1024px) {
    .inventory-content.single-item .inventory-item.video-item {
        max-width: 300px;
    }
}

.inventory-content::-webkit-scrollbar {
    width: 6px;
}

.inventory-content::-webkit-scrollbar-track {
    background: transparent;
}

.inventory-content::-webkit-scrollbar-thumb {
    background: red;
    border-radius: 3px;
}

.inventory-item {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
    z-index: 3;
}

.inventory-item.image-item {
    width: auto;
    height: auto;
    max-width: 80px;
    max-height: 80px;
    min-width: 40px;
    min-height: 40px;
}

.inventory-item.pdf-item-large {
    width: 80px;
    height: auto;
    min-height: 100px;
    box-shadow: none;
}

.inventory-item.single-glow.pdf-item-large {
    width: 120px;
    min-height: 140px;
    box-shadow: none;
}

.inventory-item-pdf-large {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
}

.inventory-item-pdf-title {
    font-size: 8px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 5px;
    line-height: 1.1;
    max-width: 80px;
    word-wrap: break-word;
}

.inventory-item-pdf-cover-large {
    width: 60px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    background: transparent;
}

.inventory-item-pdf-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.inventory-item-pdf-label-large {
    font-size: 8px;
    font-weight: bold;
    color: white;
    text-transform: lowercase;
    line-height: 1.1;
    text-align: center;
}

/* Single item PDF styling */
.inventory-content.single-item .inventory-item-pdf-title {
    font-size: 12px;
    max-width: 120px;
    margin-bottom: 8px;
}

.inventory-content.single-item .inventory-item-pdf-cover-large {
    width: 90px;
    height: 110px;
    margin-bottom: 8px;
}

.inventory-content.single-item .inventory-item-pdf-label-large {
    font-size: 12px;
}

.inventory-item.text-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-item.single-glow {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.inventory-item.single-glow.image-item {
    max-width: 160px;
    max-height: 160px;
}

/* Text items should not have glow even when single */
.inventory-item.single-glow.text-item {
    box-shadow: none;
}

.inventory-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
}

/* Text items should not have glow on hover either */
.inventory-item.text-item:hover {
    transform: scale(1.1);
    box-shadow: none;
}

.inventory-item.single-glow:hover {
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(255, 255, 255, 1);
}

/* Override hover glow for single text items too */
.inventory-item.single-glow.text-item:hover {
    transform: scale(1.15);
    box-shadow: none;
}

.inventory-item.enlarged {
    transform: scale(4);
    z-index: 280;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.inventory-item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

/* New text item styling - no background, just text */
.inventory-item-text-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 10px;
    color: white !important;
    text-align: center;
    line-height: 1.2;
    font-weight: bold;
    word-wrap: break-word;
    overflow: hidden;
    position: relative;
}

/* Force white color on ALL nested elements in text preview */
.inventory-item-text-preview * {
    color: white !important;
}

/* Smooth fade-in for lazy-loaded images */
.inventory-item-image.lazy-image {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.inventory-item-image.lazy-image.loaded,
.inventory-item-image.cached {
    opacity: 1;
}

/* Single item text styling */
.inventory-content.single-item .inventory-item.text-item {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.inventory-content.single-item .inventory-item-text-preview {
    width: 100%;
    height: 100%;
    color: white !important;
    padding: 20px;
}

.inventory-item-pdf {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    position: relative;
    background: transparent;
}

.inventory-item-pdf-cover {
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.inventory-item-pdf-cover img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.inventory-item-pdf-label {
    font-size: 5px;
    font-weight: normal;
    color: white;
    text-transform: lowercase;
    line-height: 1;
    align-self: flex-end;
}

/* Enlarged item overlay */
.enlarged-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 270;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.enlarged-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.inventory-content.viewing-item .inventory-item {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.inventory-enlarged-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 260;
}

.inventory-enlarged-image.visible {
    opacity: 1;
    pointer-events: auto;
}

.inventory-enlarged-image img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    z-index: 265;
    position: relative;
}

/* Landscape corner labels - hidden by default, only show in landscape */
.landscape-channel-name {
    display: none;
}

/* UPDATED: Show landscape name only on mobile devices in landscape */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .landscape-channel-name {
        display: block !important;
    }
}

/* UPDATED: Enhanced landscape mode display - ONLY ON MOBILE DEVICES */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    /* Hide the entire inventory overlay and all its contents in landscape */
    .inventory-overlay {
        display: none !important;
    }

    .inventory-content {
        display: none !important;
    }

    .inventory-backdrop {
        display: none !important;
    }

    /* Hide ALL opened inventory items instantly in landscape */
    .inventory-enlarged-image {
        display: none !important;
    }

    .enlarged-overlay {
        display: none !important;
    }

    .enlarged-content {
        display: none !important;
    }

    .image-close-area {
        display: none !important;
    }

    /* Hide text items instantly too */
    .text-display-overlay {
        display: none !important;
    }

    .text-display-background {
        display: none !important;
    }

    /* Hide existing UI elements in landscape */
    .channel-avatar-container,
    .antenna-dot,
    .header-info,
    .mobile-controls,
    .typo-controls,
    .age-daily,
    .title-blocker,
    .bottom-blocker,
    .channel-info-display {
        display: none !important;
    }

    /* Landscape channel name in upper-right corner */
    .landscape-channel-name {
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        color: red !important;
        font-size: 18px !important;
        font-family: Arial, sans-serif !important;
        z-index: 300 !important;
        display: block !important;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.8) !important;
    }

    /* Global channel landscape styling */
    .landscape-channel-name.global-channel {
        color: red !important;
    }
    
    /* Channel source tag in lower right corner (landscape, global channel only) */
    .channel-source-tag {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        color: white !important;
        font-size: 14px !important;
        z-index: 300 !important;
        display: none !important;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.8) !important;
        pointer-events: auto !important;
    }
    
    .channel-source-tag.visible {
        display: block !important;
    }
    
    .source-via {
        font-weight: 300;
        opacity: 0.8;
    }
    
    .source-channel-name {
        font-weight: bold;
        cursor: pointer;
    }
}

/* Optional: Hide landscape-only elements on desktop */
@media screen and (min-width: 1025px) {
    .landscape-channel-name {
        display: none !important;
    }
    
    /* Hide channel source tag in landscape position on desktop */
    .channel-source-tag {
        display: none !important;
    }
}

/* Channel source tag - default hidden, shown only in landscape on global channel */
.channel-source-tag {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: white;
    font-size: 14px;
    z-index: 300;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
}

.channel-source-tag .source-via {
    font-weight: 300;
    opacity: 0.8;
}

.channel-source-tag .source-channel-name {
    font-weight: bold;
    cursor: pointer;
}

.enlarged-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80vw;
    max-height: calc(100vh - 200px);
    z-index: 285;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.enlarged-content.visible {
    opacity: 1;
    pointer-events: auto;
}

.enlarged-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.enlarged-content .image-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.enlarged-content .image-content img {
    max-width: 90vw;
    max-height: calc(100vh - 200px);
}

.enlarged-content .image-content.horizontal {
    position: fixed;
    top: 180px;
    left: 50%;
    transform: translateX(-50%);
    width: 85vw;
    height: auto;
}

.enlarged-content .image-content.horizontal img {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 300px);
}

.enlarged-content .text-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 20px 40px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    max-width: 80vw;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.6;
    width: 70vw;
    min-height: 200px;
}

.enlarged-content .pdf-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 40px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    text-align: center;
}

/* Text display overlay */
.text-display-overlay {
    position: fixed;
    top: 90px;
    left: 50px;
    right: 50px;
    background: transparent;
    z-index: 270;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow: visible;
    height: auto;
    max-height: calc(100vh - 230px);
}

.text-display-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.text-display-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 265;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.text-display-background.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Expanded clickable area for images */
.image-close-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 260;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.image-close-area.visible {
    opacity: 1;
    pointer-events: auto;
}

.text-display-content {
    width: 100%;
    height: auto;
    min-height: 100px;
    max-height: calc(100vh - 230px);
    padding: 20px;
    overflow-y: auto;
    background: transparent;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.text-display-content::-webkit-scrollbar {
    display: none;
}

.text-display-text {
    color: white;
    font-size: 16px;
    line-height: 1.6;
    text-align: justify;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8),
                 0 0 12px rgba(255, 255, 255, 0.6),
                 0 0 16px rgba(255, 255, 255, 0.4);
    background: transparent;
}

.text-display-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.9),
                 0 0 15px rgba(255, 255, 255, 0.7),
                 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Item viewer modal */
.item-viewer {
    display: none;
}

.empty-inventory {
    color: red;
    text-align: center;
    padding: 40px;
    font-size: 16px;
    grid-column: 1 / -1;
    position: relative;
    z-index: 2;
}

.header-info {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 90px;
    color: red;
    font-size: 16px;
    z-index: 200;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
    opacity: 0;
    transform: translateY(-20px);
}

.header-info.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.header-info h1 {
    margin: 0;
    font-size: 24px;
    text-decoration: underline;
}

.header-info .bio {
    font-size: 14px;
    margin-top: 10px;
}

.header-info a {
    color: red;
    text-decoration: underline;
}

/* Global channel header styling */
.header-info.global-channel {
    color: gold;
}

.header-info.global-channel h1 {
    color: gold;
}

.header-info.global-channel a {
    color: gold;
}

/* Mobile controls */
.mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.9);
    padding: 15px;
    display: none;
    justify-content: space-around;
    align-items: center;
    z-index: 200;
}

.control-btn {
    background: red;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 50%;
    font-size: 20px;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.control-btn:active {
    background: darkred;
}

/* Typography controls */
.typo-controls {
    position: fixed;
    bottom: 55px;
    left: 10px;
    display: flex;
    gap: 8px;
    z-index: 200;
    max-width: 120px;
}

.typo-btn {
    background: transparent;
    color: red;
    border: 1px solid red;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    cursor: pointer;
    text-transform: lowercase;
    transition: background-color 0.2s ease;
}

.typo-btn:active {
    background: rgba(255, 0, 0, 0.1);
}

/* Directory */
.directory {
    position: fixed;
    bottom: 100px;
    right: 10px;
    color: red;
    font-size: 18px;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border-radius: 8px;
    z-index: 200;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.directory:active {
    background: rgba(0,0,0,0.9);
}

/* Directory dropdown */
.directory-dropdown {
    position: fixed;
    bottom: 160px;
    right: 10px;
    width: 200px;
    max-height: 300px;
    background: rgba(0,0,0,0.9);
    border-radius: 8px;
    z-index: 199;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: red transparent;
}

.directory-dropdown::-webkit-scrollbar {
    width: 6px;
}

.directory-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.directory-dropdown::-webkit-scrollbar-thumb {
    background: red;
    border-radius: 3px;
}

.directory-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.directory-item {
    color: red;
    font-size: 16px;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 0, 0, 0.2);
    transition: background-color 0.2s ease;
}

.directory-item:last-child {
    border-bottom: none;
}

.directory-item:hover {
    background: rgba(255, 0, 0, 0.1);
}

.directory-item:active {
    background: rgba(255, 0, 0, 0.2);
}

.directory-item.current {
    background: rgba(255, 0, 0, 0.15);
    font-weight: bold;
}

/* Global channel directory item styling */
.directory-item.global-channel {
    color: gold;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.directory-item.global-channel:hover {
    background: rgba(255, 215, 0, 0.1);
}

.directory-item.global-channel:active {
    background: rgba(255, 215, 0, 0.2);
}

.directory-item.global-channel.current {
    background: rgba(255, 215, 0, 0.15);
}

.age-daily {
    position: fixed;
    bottom: 100px;
    left: 10px;
    color: red;
    font-size: 18px;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border-radius: 8px;
    z-index: 350; 
}

/* Swipe overlay */
.swipe-overlay {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 120px;
    z-index: 150;
    background: transparent;
    touch-action: pan-y;
}

/* Black bar to hide video title */
.title-blocker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px; /* Increased from 60px */
    background: black;
    z-index: 100; /* Above video but below UI */
    pointer-events: auto; /* Block clicks */
}

/* Black bar to hide related videos at bottom */
.bottom-blocker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px; /* Increased from 80px */
    background: black;
    z-index: 100; /* Above video but below UI */
    pointer-events: auto; /* Block clicks */
}

/* UPDATED: OLD landscape query for header-info - now restricted to mobile devices only */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .enlarged-overlay {
        display: none !important;
    }

    .channel-avatar-container,
    .antenna-dot,
    .header-info,
    .mobile-controls,
    .typo-controls,
    .age-daily, 
    #typoPressBtn,
    #typoIndexBtn {
        display: none !important;
    }
}
/* Hide avatar when channel index is visible */
.channel-index-overlay.visible ~ .channel-avatar-container {
    opacity: 0;
    pointer-events: none;
}
/* Black background for channel index when on global channel */
.channel-index-overlay.visible {
    background: transparent; /* Default transparent */
}

/* Black background only when viewing global channel */
.global-channel-active .channel-index-overlay.visible {
    background: rgba(0, 0, 0, 0.95);
}
@keyframes tvDistortion {
    0% {
        transform: scaleX(1.1) skewX(-3deg);
        letter-spacing: 3px;
        filter: blur(2px);
    }
    15% {
        transform: scaleX(0.95) skewX(2deg);
        letter-spacing: -1px;
        filter: blur(1px);
    }
    30% {
        transform: scaleX(1.05) skewX(-1deg);
        letter-spacing: 1px;
        filter: blur(0.5px);
    }
    50% {
        transform: scaleX(0.98) skewX(0.5deg);
        letter-spacing: 0px;
        filter: blur(0px);
    }
    100% {
        transform: scaleX(1) skewX(0deg);
        letter-spacing: 0px;
        filter: blur(0px);
    }
}
/* Enhanced channel avatar container with smooth transitions */
.channel-avatar-container {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    z-index: 250;
    cursor: pointer;
    /* UPDATED: Smooth transition for all properties including transform and opacity */
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1),
                opacity 0.5s ease;
}

/* Smooth transition for blog mode */
.channel-avatar-container.blog-mode {
    top: 120px;
    left: 20px;
    right: auto;
    width: 50px;
    height: 50px;
}


/* The actual avatar with smooth transitions */
.channel-avatar {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid red;
    z-index: 250;
    /* UPDATED: Smooth transition matching container */
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.channel-avatar.blog-mode {
    top: 120px;
    left: 20px;
    right: auto;
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

/* Antenna stems with smooth fade */
.channel-avatar-container::before,
.channel-avatar-container::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 15px;
    background: red;
    top: -15px;
    /* UPDATED: Smooth opacity transition */
    transition: opacity 0.4s ease;
}

.channel-avatar-container::before {
    left: 15px;
    transform: rotate(-20deg);
}

.channel-avatar-container::after {
    right: 15px;
    transform: rotate(20deg);
}

/* Hide antenna stems smoothly in blog mode */
.channel-avatar-container.blog-mode::before,
.channel-avatar-container.blog-mode::after {
    opacity: 0;
}

/* Antenna dots with smooth transitions */
.antenna-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: red;
    border-radius: 50%;
    top: -20px;
    z-index: 251;
    /* UPDATED: Smooth opacity transition */
    transition: opacity 0.4s ease;
}

.antenna-dot.left {
    left: 10px;
}

.antenna-dot.right {
    right: 10px;
}

.antenna-dot.hidden {
    opacity: 0;
}

/* Active click feedback - keep snappy */
.channel-avatar-container:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Global channel styling */
.channel-avatar-container.global-channel {
    border: 3px solid gold;
}

.channel-avatar-container.global-channel .channel-avatar {
    border: 3px solid gold;
}

.channel-avatar-container.global-channel::before,
.channel-avatar-container.global-channel::after {
    background: gold;
}
/* Position global channel info lower - aligned with top typo controls */
.channel-info-display.global-channel {
    bottom: 55px; /* Same as typo-controls bottom position */
}
/* Navigation Instructions */
.nav-instructions {
    position: fixed;
    top: 60px;
    left: 20px;
    color: gold;
    font-size: 14px;
    z-index: 250;
    line-height: 1.6;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.nav-instruction-line {
    opacity: 1;
    transition: opacity 0.5s ease;
}

.nav-instruction-line.hidden {
    opacity: 0;
}

/* Hide instructions in inventory mode */
.inventory-overlay.visible ~ .nav-instructions {
    opacity: 0;
}

/* Hide instructions when channel index is open */
.channel-index-overlay.visible ~ .nav-instructions {
    opacity: 0;
}

/* Hide instructions when viewing items */
.channel-avatar-container.item-viewing ~ .nav-instructions {
    opacity: 0;
}

/* Hide in landscape mode on mobile */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    .nav-instructions {
        display: none !important;
    }
}

/* Desktop instructions - different text */
@media screen and (min-width: 1025px) {
    .nav-instructions {
        font-size: 12px;
    }
    
    /* Horizontal layout for channel info links on desktop */
    .channel-info-links {
        flex-direction: row;
        gap: 12px;
    }

    /* Desktop inventory grid - much larger images that actually touch */
    .inventory-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 0px;
        column-gap: 0px;
        row-gap: 0px;
        align-content: start;
        padding: 40px;
        grid-auto-rows: auto;
    }
    
    /* First row items positioned to avoid avatar - desktop specific */
    .inventory-content .inventory-item:nth-child(1) {
        grid-column: 2;
    }
    
    .inventory-content .inventory-item:nth-child(2) {
        grid-column: 3;
    }
    
    .inventory-content .inventory-item:nth-child(3) {
        grid-column: 4;
    }
    
    .inventory-content .inventory-item:nth-child(n+4) {
        grid-column: auto;
    }
    
    /* Much larger images that fill cells and touch */
    .inventory-item.image-item {
        width: 100%;
        height: 200px; /* Reduced from 350px for faster loading */
        max-width: none;
        max-height: none;
        min-width: 0;
        min-height: 0;
        box-shadow: none;
    }
    
    .inventory-item-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Remove hover effects that might add spacing */
    .inventory-item:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Larger PDFs for desktop */
    .inventory-item.pdf-item-large {
        width: 200px;
        min-height: 250px;
    }
    
    .inventory-item.single-glow.pdf-item-large {
        width: 250px;
        min-height: 300px;
    }
    
    .inventory-item-pdf-title {
        font-size: 14px;
        max-width: 200px;
    }
}
.channel-info-pocket {
    font-size: 12px;
    opacity: 0.8;
    text-decoration: underline;
    cursor: pointer;
    display: block;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 250;
    padding: 8px;
    margin: -8px;
}

.channel-info-pocket:hover {
    opacity: 1;
}

.channel-info-pocket:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.channel-info-pocket.item-viewing {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
/* Desktop-specific: Simple fade for avatar transitions */
@media screen and (min-width: 1025px) {
    .channel-avatar-container {
        /* Remove position transitions on desktop - only fade */
        transition: opacity 0.3s ease !important;
    }
    
    .channel-avatar-container.blog-mode {
        /* Instant position change, only fade */
        transition: opacity 0.3s ease, 
                    top 0s, 
                    left 0s, 
                    right 0s, 
                    width 0s, 
                    height 0s !important;
    }
    
    .channel-avatar {
        /* Desktop: Only fade, no position animation */
        transition: opacity 0.3s ease !important;
    }
    
    .channel-avatar.blog-mode {
        /* Instant position change, only fade */
        transition: opacity 0.3s ease, 
                    border-radius 0.3s ease,
                    top 0s, 
                    left 0s, 
                    right 0s, 
                    width 0s, 
                    height 0s !important;
    }
    
    /* Remove the scale effect on active for desktop */
    .channel-avatar-container:active {
        transform: none !important;
    }
}


    }
}

}

.desktop-episode-title-line2 {
    display: block;
    margin-top: 4px;
}

/* Show desktop version only on desktop */
@media screen and (min-width: 1025px) {
    .mobile-now-playing {
        display: none !important;
    }
    
    .desktop-episode-title {
        display: block;
    }
}

/* OLD episode title in channel info - REMOVE */
.channel-episode-title {
    display: none !important;
}

/* ===== DESKTOP: Episode Title Display ===== */
/* Title appears in upper left corner */
.desktop-episode-title {
    position: fixed;
    left: 20px;
    top: 50%; transform: translateY(-50%);
    z-index: 300;
    color: white;
    font-size: 120px;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    max-width: calc(100vw - 200px);
    word-wrap: break-word;
    display: none;
}

.desktop-episode-title.visible {
    opacity: 1;
}

/* Episode number appears in channel info (lower right) */
.channel-episode-number {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-align: right;
    margin-top: 8px;
    display: none;
}

/* Show desktop version only on desktop */
@media screen and (min-width: 1025px) {
    .mobile-now-playing {
        display: none !important;
    }
    
    .desktop-episode-title {
        display: block;
    }
}

/* OLD episode title in channel info - REMOVE */
.channel-episode-title {
    display: none !important;
}

/* ===== MOBILE: Now Playing Display ===== */
/* ===== DESKTOP: Episode Title Display ===== */
.desktop-episode-title {
    position: fixed;
    left: 20px;
    top: 50%; transform: translateY(-50%);
    z-index: 300;
    color: white;
    font-size: 120px;
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.2;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    max-width: calc(100vw - 200px);
    word-wrap: break-word;
    display: none;
}

.desktop-episode-title.visible {
    opacity: 1;
}

.desktop-episode-line1 {
    display: block;
}

.desktop-episode-line2 {
    display: block;
}

/* Desktop-specific rules */
@media screen and (min-width: 1025px) {
    .mobile-now-playing {
        display: none !important;
    }
    
    .desktop-episode-title {
        display: block;
    }
    
    /* Hide channel info when index is open */
    body.index-open .channel-info-display {
        display: none !important;
    }
}

/* Remove old styles */
.channel-episode-title,
.channel-episode-number {
    display: none !important;
}

/* Folder item styling in inventory grid */
.inventory-item.folder-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-item.folder-item::before {
    content: "ðŸ“";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    opacity: 0.8;
}

.inventory-item.folder-item .inventory-item-name {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px;
    font-size: 14px;
    z-index: 1;
}

/* Mobile-specific: Remove glowing box and position name closer to icon */
@media screen and (max-width: 1024px) {
    .inventory-item.folder-item {
        background: transparent;
        border: none;
        box-shadow: none;
    }
    
    .inventory-item.folder-item:hover {
        box-shadow: none;
    }
    
    .inventory-item.folder-item .inventory-item-name {
        position: absolute;
        top: 55%;
        bottom: auto;
        left: 50%;
        transform: translateX(-50%);
        background: transparent;
        padding: 4px 8px;
        font-size: 14px;
        white-space: normal;
        width: auto;
        max-width: 120px;
        text-align: center;
        line-height: 1.3;
    }
}

/* Video thumbnail styling in inventory grid */
.inventory-item.video-item {
    background-size: cover;
    background-position: center;
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
}

/* Small play icon in bottom right of thumbnail */
.inventory-item.video-item::before {
    content: "â–¶";
    position: absolute;
    bottom: 30px;
    right: 5px;
    font-size: 16px;
    color: white;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
    z-index: 2;
}

/* Episode number below thumbnail */
.inventory-item.video-item .inventory-item-name {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    background: transparent;
    padding: 4px;
    font-size: 12px;
    text-align: center;
    color: white;
    z-index: 1;
}

/* Movie items - same dimensions as video items */
.inventory-item.movie-item {
    background-size: cover;
    background-position: center;
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
}

.inventory-item.movie-item::before {
    content: "▶";
    position: absolute;
    bottom: 30px;
    right: 5px;
    font-size: 16px;
    color: white;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
    z-index: 2;
}

.inventory-item.movie-item .inventory-item-name {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    background: transparent;
    padding: 4px;
    font-size: 12px;
    text-align: center;
    color: white;
    z-index: 1;
}

/* Folder breadcrumb */
.folder-breadcrumb {
    position: fixed;
    top: 140px;
    left: 20px;
    color: white;
    font-size: 14px;
    z-index: 290;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.folder-breadcrumb:h
/* Desktop: Image items should be square, video/text/movie items 16:9 */
@media screen and (min-width: 1025px) {
    .inventory-item.image-item {
        aspect-ratio: 1 / 1;
        height: 200px; /* Reduced from 350px for faster loading */
    }
    
    .inventory-item.video-item,
    .inventory-item.movie-item {
        aspect-ratio: 16 / 9;
        height: auto;
        width: 100%;
    }
    
    .inventory-item.text-item {
        aspect-ratio: 16 / 9;
        height: auto;
        width: 100%;
    }
    
    .inventory-item.folder-item {
        aspect-ratio: 1 / 1;
        height: 200px; /* Reduced from 350px for faster loading */
    }
}

/* Mobile: Adjust grid and aspect ratios */
@media screen and (max-width: 1024px) {
    .inventory-item.image-item {
        aspect-ratio: 1 / 1;
        width: 100%;
        height: auto;
    }
    
    .inventory-item.video-item,
    .inventory-item.movie-item {
        aspect-ratio: 16 / 9;
        height: auto;
        width: 100%;
        margin-bottom: 0; /* Removed extra space since we're hiding labels */
    }
    
    /* Hide video/movie labels on mobile */
    .inventory-item.video-item .inventory-item-name,
    .inventory-item.movie-item .inventory-item-name {
        display: none;
    }
    
    .inventory-item.text-item {
        aspect-ratio: 16 / 9;
        height: auto;
        width: 100%;
        margin-bottom: 0;
    }
    
    .inventory-item.folder-item {
        aspect-ratio: 1 / 1;
        width: 100%;
        height: auto;
    }
    
    /* More row gap on mobile when there are video items */
    .inventory-content {
        row-gap: 35px;
    }
}
/* Mobile Now Playing Display - Three lines in upper left */
/* Mobile Episode Display - positioned across from channel avatar */
.mobile-now-playing {
    display: none;
    position: fixed;
    top: 60px;
    left: 20px;
    z-index: 200;
    text-align: left;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    max-width: calc(100vw - 120px); /* Leave room for avatar on right */
}

.mobile-now-playing.visible {
    opacity: 1;
}

.mobile-episode-title {
    font-size: 28px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    color: white;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    margin-bottom: 4px;
}

.mobile-episode-number {
    font-size: 16px;
    color: white;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* Only show on mobile */
@media screen and (max-width: 1024px) {
    .mobile-now-playing {
        display: block;
    }
    
    /* Hide in landscape or when index is open */
    body.landscape-mode .mobile-now-playing,
    body.index-open .mobile-now-playing {
        display: none !important;
    }
}