/* Channel Accent Color Variable */
:root {
    --channel-accent: red;
}

/* 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;
}

/* YouTube Player Wrapper for blockers */
.yt-player-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.yt-player-wrapper #youtube-player {
    position: absolute;
    z-index: 1;
}

/* YouTube UI Blockers - black bars that cover controls temporarily */
.yt-blocker {
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    background: black;
    z-index: 100;
    transition: transform 0.6s ease-out;
    pointer-events: none;
}

.yt-blocker-top {
    top: 0;
    transform: translateY(0);
}

.yt-blocker-top.hidden {
    transform: translateY(-100%);
}

.yt-blocker-bottom {
    bottom: 0;
    transform: translateY(0);
}

.yt-blocker-bottom.hidden {
    transform: translateY(100%);
}

/* Video cover for inventory mode */
/* FAST LOAD: Start visible by default for instant load on root URL */
.video-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 2;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

/* Hidden state for when video should show through */
.video-cover.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ============================================================================
   POCKET VIEWING MODE - Content takes over the TV
   ============================================================================ */

.pocket-viewing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Above player, below UI controls */
    background: black;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pocket-viewing-overlay.active {
    display: flex;
}

.pocket-viewing-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto; /* Allow scrolling for tall content */
    position: relative;
}

/* Text content in pocket viewing */
.pocket-text-content {
    max-width: 800px;
    max-height: 90vh;
    padding: 40px;
    color: #ccc; /* Light text for black background */
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.7;
    overflow-y: auto;
    text-align: left;
}

.pocket-text-content::-webkit-scrollbar {
    width: 4px;
}

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

.pocket-text-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

/* Image content in pocket viewing */
.pocket-image-content {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}

/* Video content in pocket viewing (YouTube) */
.pocket-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Swipe overlay for videos/movies - captures touch events over iframes */
.pocket-video-swipe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: transparent;
}

.pocket-video-player {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
}

#pocketYouTubePlayerContainer {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
}

#pocketYouTubePlayerContainer iframe {
    width: 100%;
    height: 100%;
}

/* Movie content in pocket viewing (Dropbox videos) */
.pocket-movie-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
    position: relative;
}

.pocket-movie-player {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

.pocket-movie-fullscreen-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.pocket-movie-container:hover .pocket-movie-fullscreen-btn,
.pocket-movie-fullscreen-btn:hover {
    opacity: 1;
}

.pocket-movie-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Pocket video/movie blockers (black bars that recede) */
.pocket-blocker {
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    background: black;
    z-index: 50;
    transition: transform 0.6s ease-out;
    pointer-events: none;
}

.pocket-blocker-top {
    top: 0;
    transform: translateY(0);
}

.pocket-blocker-top.hidden {
    transform: translateY(-100%);
}

.pocket-blocker-bottom {
    bottom: 0;
    transform: translateY(0);
}

.pocket-blocker-bottom.hidden {
    transform: translateY(100%);
}

/* Pocket video/movie title overlay - matches episode title styling */
.pocket-media-title {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 120px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    line-height: 1.2;
    z-index: 60;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
    max-width: calc(100vw - 200px);
    word-wrap: break-word;
}

.pocket-media-title.hidden {
    opacity: 0;
}

/* Mobile: smaller title */
@media screen and (max-width: 1024px) {
    .pocket-media-title {
        font-size: 28px;
        top: 60px;
        transform: none;
        max-width: calc(100vw - 120px);
        text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    }
}

/* PDF content in pocket viewing */
.pocket-pdf-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.pocket-pdf-page {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.pocket-pdf-page-number {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-family: Georgia, serif;
}

/* PDF page container - clickable area */
.pocket-pdf-page-container {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Spread containers should fill available space */
.pocket-pdf-spread .pocket-pdf-page-container {
    flex: 1;
    height: 100%;
    min-height: 80vh;
}

/* PDF canvas rendering */
.pocket-pdf-canvas {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    background: white;
}

/* Single page view (cover/back cover) */
.pocket-pdf-single .pocket-pdf-canvas {
    max-height: 85vh;
}

/* PDF loading state */
.pocket-pdf-loading {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    font-family: Georgia, serif;
    font-style: italic;
}

/* Two-page spread container */
.pocket-pdf-spread {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: row;
}

.pocket-pdf-spread-view {
    flex-direction: column;
}

.pocket-pdf-spread canvas {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    background: white;
}

/* Left and right page click areas */
.pocket-pdf-left,
.pocket-pdf-right {
    position: relative;
}

.pocket-pdf-left::after,
.pocket-pdf-right::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pocket-pdf-left::after {
    left: 0;
}

.pocket-pdf-right::after {
    right: 0;
}

/* Mobile PDF: scrollable container with all pages */
.pocket-pdf-mobile-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    touch-action: pan-y pinch-zoom;
}

.pocket-pdf-mobile-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0 100px 0;
    -webkit-overflow-scrolling: touch;
    transform-origin: top center;
}

.pocket-pdf-canvas-mobile {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: white;
    flex-shrink: 0;
}

/* Desktop PDF: scrollable spreads container */
.pocket-pdf-desktop-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.pocket-pdf-desktop-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    padding: 40px 0 100px 0;
}

.pocket-pdf-desktop-spread {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.pocket-pdf-desktop-spread .pocket-pdf-spread {
    display: flex;
    gap: 4px;
}

.pocket-pdf-desktop-spread .pocket-pdf-single-page {
    display: flex;
    justify-content: center;
}

.pocket-pdf-canvas-desktop {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: white;
}

/* Mobile: hide desktop spread view */
@media screen and (max-width: 768px) {
    .pocket-pdf-spread {
        display: none;
    }

    .pocket-pdf-single {
        display: none;
    }
}

/* Side arrows for skipping pocket items */
.pocket-skip-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0.3;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 24px;
}

.pocket-skip-arrow:hover {
    opacity: 0.8;
}

.pocket-skip-prev {
    left: 10px;
}

.pocket-skip-next {
    right: 10px;
}

/* Hide arrows when only one item or at boundaries */
.pocket-skip-arrow.hidden {
    display: none;
}

/* Magnifying glass */
.pocket-magnifier {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    pointer-events: none;
    display: none;
    z-index: 100;
}

.pocket-magnifier.active {
    display: block;
}

.pocket-magnifier canvas {
    width: 100%;
    height: 100%;
}

/* Navigation hint at bottom */
.pocket-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.pocket-close-btn:hover {
    opacity: 0.7;
}

/* Hide close button when viewing PDFs */
.pocket-viewing-overlay:has(.pocket-pdf-mobile-container) .pocket-close-btn,
.pocket-viewing-overlay:has(.pocket-pdf-desktop-container) .pocket-close-btn {
    display: none;
}

/* Highlight/feature button for owners */
.pocket-highlight-btn {
    position: fixed;
    top: 20px;
    right: 70px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(80, 80, 80, 0.6);
    border: none;
    color: white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.pocket-highlight-btn:hover {
    background: rgba(100, 100, 100, 0.8);
}

.pocket-highlight-btn.active {
    color: gold;
    background: rgba(100, 80, 0, 0.6);
}

.pocket-viewing-nav {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 1;
    transition: opacity 0.6s ease-out;
}

.pocket-viewing-nav.hidden {
    opacity: 0;
}

.pocket-nav-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-style: italic;
    text-align: center;
}

/* ============================================================================
   POCKET SCROLL VIEW MODE - Vertical scrolling through all items
   ============================================================================ */

.pocket-scroll-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.pocket-scroll-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.pocket-scroll-item {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* PDF Cover in Scroll View */
.pocket-scroll-pdf {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pocket-scroll-pdf:active {
    transform: scale(0.98);
}

.pdf-cover-wrapper {
    position: relative;
    display: inline-block;
}

.pdf-cover-canvas {
    display: block;
    box-shadow:
        0 0 40px rgba(255, 255, 255, 0.12),
        0 0 80px rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

.pdf-cover-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.pdf-cover-label {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-family: Georgia, serif;
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 1px;
}

/* Images in Scroll View */
.pocket-scroll-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-view-image {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}

/* Text in Scroll View */
.pocket-scroll-text {
    width: 100%;
    max-width: 800px;
}

.scroll-view-text {
    color: #ccc;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.8;
    text-align: left;
    padding: 30px 0;
}

/* Video/Movie in Scroll View */
.pocket-scroll-video,
.pocket-scroll-movie {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scroll-video-wrapper,
.scroll-movie-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 95vw;
    max-height: 90vh;
}

.scroll-view-thumbnail {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
}

.scroll-view-movie-preview {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    background: #000;
}

/* YouTube iframe in scroll view */
.scroll-youtube-container {
    width: 100%;
    max-width: 95vw;
    aspect-ratio: 16/9;
    max-height: 85vh;
}

.scroll-youtube-container iframe {
    width: 100%;
    height: 100%;
}

.scroll-media-label {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-family: Georgia, serif;
    font-style: italic;
    text-transform: lowercase;
    letter-spacing: 1px;
}

/* Unmute button for videos/movies in scroll view */
.scroll-unmute-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.scroll-unmute-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.scroll-unmute-btn.muted::before {
    content: "🔇";
}

.scroll-unmute-btn.unmuted::before {
    content: "🔊";
}

/* Album in Scroll View */
.pocket-scroll-album {
    cursor: pointer;
}

.scroll-view-album-cover {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
}

.scroll-album-label {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-family: Georgia, serif;
    font-style: italic;
}

/* Detail overlay for horizontal swipe navigation */
.pocket-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile scroll view adjustments */
@media screen and (max-width: 768px) {
    .pocket-scroll-content {
        padding: 60px 15px 100px 15px;
        gap: 50px;
    }

    .scroll-view-text {
        font-size: 16px;
        line-height: 1.7;
        padding: 20px 0;
    }

    .pdf-cover-canvas {
        max-width: 75vw;
    }

    .scroll-play-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .pocket-text-content {
        padding: 25px;
        font-size: 17px;
        max-width: 100%;
    }

    .pocket-pdf-page {
        max-width: 95vw;
        max-height: 85vh;
    }
}

.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;
    /* Glow effect - swap animation name to try different options:
       borderLights = rotating spotlight (original)
       glowPulse = gentle breathing (Option 2)
       glowStatic = constant soft glow (Option 3)
       glowFilm = warm film flicker (Option 4) */
    animation: glowPulse 4s ease-in-out infinite;
    border: none;
}

/* OPTION 1: Original rotating spotlight (current) */
@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);
    }
}

/* OPTION 2: Gentle breathing pulse - soft glow fades in and out */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 15px 3px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 25px 6px rgba(255, 255, 255, 0.4);
    }
}

/* OPTION 3: Static soft glow - no animation, just constant subtle glow */
@keyframes glowStatic {
    0%, 100% {
        box-shadow: 0 0 20px 4px rgba(255, 255, 255, 0.25);
    }
}

/* OPTION 4: Warm film flicker - occasional subtle warm pulse */
@keyframes glowFilm {
    0%, 90%, 100% {
        box-shadow: 0 0 12px 2px rgba(255, 245, 230, 0.15);
    }
    92% {
        box-shadow: 0 0 18px 4px rgba(255, 240, 220, 0.35);
    }
    95% {
        box-shadow: 0 0 10px 2px rgba(255, 245, 230, 0.1);
    }
    97% {
        box-shadow: 0 0 20px 5px rgba(255, 235, 210, 0.3);
    }
}

.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: var(--channel-accent);
    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;
}

/* Video Modal - Muted autoplay preview with glow effect */
.modal-video-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: white;
    padding: 0;
    position: relative;
    cursor: pointer;
}

.modal-video-glow .modal-video-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 16 / 9;
    animation: glowPulse 4s ease-in-out infinite;
    overflow: hidden; /* Hide the enlarged iframe edges */
}

.modal-video-iframe {
    /* Enlarge iframe to crop out YouTube UI elements */
    position: absolute;
    top: -60px;
    left: -60px;
    width: calc(100% + 120px);
    height: calc(100% + 120px);
    pointer-events: none; /* Prevent interaction with iframe */
}

.modal-video-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    padding-bottom: 15px;
}

.modal-video-play-hint {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-style: italic;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Movie Modal - muted autoplay preview with glow effect */
.modal-movie-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: white;
    padding: 0;
    position: relative;
    cursor: pointer;
}

.modal-movie-glow .modal-movie-player-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    animation: glowPulse 4s ease-in-out infinite;
    overflow: hidden;
}

.modal-movie-video {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.modal-movie-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
}

.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 */
/* FAST LOAD: Start visible by default for instant load on root URL */
/* NO transition on initial load - JS adds .animated class after first interaction */
.channel-index-overlay {
    position: fixed;
    top: 80px;
    left: 20px;
    right: 20px;
    bottom: 120px;
    background: transparent;
    z-index: 240;
    opacity: 1;
    transform: translateY(0);
    transition: none;
    pointer-events: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Only animate after user interacts */
.channel-index-overlay.animated {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Visible class shows the overlay */
.channel-index-overlay.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Hidden state - JS adds this class when closing the overlay */
.channel-index-overlay.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* DIRECT CHANNEL LINK: Hide overlay immediately when URL has channel path */
.direct-channel-link .channel-index-overlay {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    pointer-events: none !important;
}

.direct-channel-link .video-cover {
    opacity: 0 !important;
    pointer-events: none !important;
}

.direct-channel-link .channel-avatar-container {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Hide channel info until correct channel loads */
.direct-channel-link .channel-info-display {
    opacity: 0;
}

.direct-channel-link .header-info {
    opacity: 0;
}

/* Channel Index Header - hidden */
.channel-index-header {
    display: none;
}

/* 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: var(--channel-accent);
    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: var(--channel-accent) 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: var(--channel-accent);
    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 var(--channel-accent);
    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: var(--channel-accent);
    font-weight: bold;
}

.channel-index-item-grid.current .channel-index-grid-avatar {
    border: 2px solid var(--channel-accent);
    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-color: white;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid var(--channel-accent);
    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: var(--channel-accent);
    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 - hidden by default since overlay starts visible */
.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);
    opacity: 0;
    pointer-events: none;
}

.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: var(--channel-accent);
    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;
}

/* Mobile: Hide avatar completely when in pocket/blog mode */
@media screen and (max-width: 768px) {
    .channel-avatar-container.blog-mode {
        opacity: 0 !important;
        pointer-events: none !important;
    }

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

    .channel-avatar-container.blog-mode .antenna-dot {
        opacity: 0 !important;
    }
}

/* Global channel special styling */
.channel-avatar-container.global-channel {
    border: none;
    width: auto;
    height: auto;
    cursor: default;
    pointer-events: none;
}

.channel-avatar-container.global-channel .channel-avatar {
    display: none;
}

.channel-avatar-container.global-channel::before,
.channel-avatar-container.global-channel::after {
    display: none;
}

.channel-avatar-container.global-channel .antenna-dot {
    display: none;
}

/* Hide hover highlight on global channel */
.channel-avatar-container.global-channel .avatar-hover-highlight {
    display: none !important;
}

/* Global channel title - replaces avatar on global channel (desktop only) */
.global-channel-title {
    display: none;
    color: white;
    font-size: 120px;
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    white-space: nowrap;
}

.global-channel-title span {
    display: inline;
}

/* Two-line layout when shop is open */
.global-channel-title.two-line {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    white-space: normal;
    line-height: 0.9;
}

.global-channel-title.two-line span {
    display: block;
}

/* Hide big Age Daily title on mobile - show in channel-info-display instead */
@media screen and (max-width: 1024px) and (orientation: portrait) {
    .global-channel-title {
        display: none !important;
    }
}

.channel-avatar-container.global-channel .global-channel-title {
    display: flex;
}

/* Also show via body/html class for direct global channel loads */
body.global-channel-active .channel-avatar-container .global-channel-title,
html.global-channel-active .channel-avatar-container .global-channel-title {
    display: flex;
}

/* Hide Age Daily title when channel index is open */
.channel-index-overlay.visible ~ .channel-avatar-container .global-channel-title {
    display: none !important;
}

/* Hide Age Daily title when pocket/inventory is open */
.inventory-overlay.visible ~ .channel-avatar-container .global-channel-title {
    display: none !important;
}

/* Make avatar container visible on global channel */
body.global-channel-active .channel-avatar-container,
html.global-channel-active .channel-avatar-container {
    opacity: 1;
    pointer-events: auto;
}

/* Hide the regular avatar image on global channel */
body.global-channel-active .channel-avatar-container .channel-avatar,
html.global-channel-active .channel-avatar-container .channel-avatar {
    opacity: 0;
}

/* 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;
}

/* Video title display (desktop only) */
.channel-video-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Channel source info (via ChannelName) */
.channel-info-source {
    font-size: 14px;
    margin-bottom: 4px;
    opacity: 0.9;
    pointer-events: auto; /* Enable clicks on source */
    cursor: pointer;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7); /* Visibility against black */
}

/* About link (home channel only) */
.channel-info-about {
    font-size: 14px;
    color: white;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

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

/* Hide video title on mobile */
@media (max-width: 768px) {
    .channel-video-title {
        display: none !important;
    }
}

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

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

.channel-info-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.7);
}

.channel-info-subtitle a {
    font-weight: bold;
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
    cursor: pointer;
}

.channel-info-subtitle a:hover {
    text-decoration: underline;
}

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

/* External link above notebook/pocket */
.channel-info-external {
    text-align: right;
    margin-bottom: 4px;
}

.channel-info-external a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.channel-info-external a:hover {
    opacity: 1;
}

/* Container for links - horizontal layout */
.channel-info-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

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

/* 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 var(--channel-accent);
    margin-bottom: 30px;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.3);
}

.channel-preview-info {
    color: var(--channel-accent);
    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: var(--channel-accent);
    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: 60px;
    left: 0;
    right: 0;
    bottom: 100px;
    background: black;
    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;
}

/* Pocket close button - hidden in old style */
.pocket-close-x {
    display: none !important;
}

/* 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: var(--channel-accent);
    font-size: 14px;
    line-height: 1.6;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(100px, auto);
    gap: 10px;
    align-content: start;
    justify-items: center;
    padding: 20px 20px 20px 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--channel-accent) 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;
}

/* All items flow normally - no blank first slot */
.inventory-content .inventory-item {
    grid-column: auto;
}

/* Mobile: 3 columns */
@media screen and (max-width: 768px) {
    .inventory-content {
        grid-template-columns: repeat(3, 1fr);
        justify-content: center;
        padding: 15px 15px 15px 15px;
    }
}

/* 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: var(--channel-accent);
    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;
}

/* Delete button for pocket items (owner mode) */
.pocket-item-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(200, 60, 60, 0.9);
    border: 2px solid white;
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.inventory-item:hover .pocket-item-delete {
    opacity: 1;
}

.pocket-item-delete:hover {
    background: rgba(220, 40, 40, 1);
    transform: scale(1.1);
}

/* Highlight/star button in pocket grid */
.pocket-item-highlight {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(80, 80, 80, 0.9);
    border: 2px solid white;
    color: white;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.inventory-item:hover .pocket-item-highlight {
    opacity: 1;
}

.pocket-item-highlight:hover {
    background: rgba(100, 100, 100, 1);
    transform: scale(1.1);
}

.pocket-item-highlight.active {
    background: rgba(180, 140, 0, 0.9);
    color: gold;
    opacity: 1;
}

.pocket-item-highlight.active:hover {
    background: rgba(200, 160, 0, 1);
}

.inventory-item .pocket-item-highlight {
    pointer-events: auto;
}

/* Drag and drop states for pocket items */
.inventory-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.inventory-item.drag-over {
    outline: 2px dashed white;
    outline-offset: 4px;
}

.inventory-item[draggable="true"] {
    cursor: grab;
}

.inventory-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Prevent images from being dragged separately */
.inventory-item[draggable="true"] img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Ghost element for custom drag */
.pocket-drag-ghost {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Delete button must be clickable */
.inventory-item .pocket-item-delete {
    pointer-events: auto;
}

.inventory-item.image-item {
    width: 150px;
    height: 150px;
    object-fit: cover;
}

.inventory-item.pdf-item-large {
    width: 150px;
    height: 150px;
    box-shadow: none;
    overflow: visible;
}

.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;
}

/* Album item styles */
.inventory-item.album-item {
    width: 150px;
    height: 150px;
    overflow: visible;
}

.inventory-item-album {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.inventory-item-album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-item-album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

.inventory-item-album-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-item-album-badge svg {
    stroke: white;
}

.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: 150px;
    height: 150px;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.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: var(--channel-accent) !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: var(--channel-accent) !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;
}

/* Maintained by - same line as est. 2025 A.D. */
.maintained-by {
    display: none;
    position: fixed;
    bottom: 40px;
    right: 20px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    z-index: 300;
    pointer-events: auto;
}

.maintained-by span {
    opacity: 0.8;
}

/* Contact email - below maintained by */
.contact-email {
    display: none;
    position: fixed;
    bottom: 25px;
    right: 20px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    z-index: 300;
    pointer-events: auto;
}

.contact-email a {
    color: white;
    opacity: 0.8;
    text-decoration: none;
}

.contact-email a:hover {
    text-decoration: underline;
}

/* Mention links - @username style */
.mention-link {
    color: white;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
}

.mention-link:hover {
    text-decoration: underline;
}

.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: var(--channel-accent);
    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: var(--channel-accent);
    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: var(--channel-accent);
    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: var(--channel-accent);
    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;
}

/* Shop coming soon message */
.shop-coming-soon {
    position: fixed;
    top: 15px;
    left: 15px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.shop-coming-soon.visible {
    opacity: 1;
}

/* Mobile channel navigation arrows */
.mobile-channel-arrows {
    display: none;
}

@media screen and (max-width: 1024px) and (orientation: portrait) {
    .mobile-channel-arrows {
        display: flex;
        flex-direction: column;
        gap: 4px;
        position: fixed;
        top: 45%;
        transform: translateY(-50%);
        right: 20px;
        z-index: 200;
    }

    .mobile-arrow-btn {
        width: 24px;
        height: 20px;
        background: transparent;
        border: 1px solid var(--channel-accent);
        border-radius: 3px;
        color: var(--channel-accent);
        font-size: 12px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-arrow-btn:active {
        opacity: 0.6;
    }

    /* Move navigation buttons to right on mobile */
    .typo-controls {
        left: auto !important;
        right: 180px !important;
        bottom: 25px !important;
    }

    #homeIndexButtons {
        left: auto !important;
        right: 20px !important;
    }

    /* Nudge channel info up on mobile (except Caveh) */
    .channel-info-display:not(.caveh-active) {
        bottom: 75px !important;
    }

    /* Hide mobile channel arrows when notebook or pocket (album) is open */
    body:has(.notes-viewing-overlay.active) .mobile-channel-arrows,
    body:has(.pocket-viewing-overlay.active) .mobile-channel-arrows {
        display: none !important;
    }
}

/* 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: var(--channel-accent);
    border: 1px solid var(--channel-accent);
    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: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

/* Desktop logout button - owner channel only */
.desktop-logout {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 127px;
    z-index: 200;
}

@media screen and (min-width: 1025px) {
    .desktop-logout.visible {
        display: block;
    }
}

/* Channel navigation arrows - desktop only */
.channel-nav-arrows {
    display: none;
}

@media screen and (min-width: 1025px) {
    .channel-nav-arrows {
        display: flex;
        flex-direction: column;
        gap: 2px;
        position: fixed;
        bottom: 25px;
        left: 200px;
        z-index: 200;
    }

    .arrow-key-btn {
        width: 24px;
        height: 20px;
        background: transparent;
        border: 1px solid var(--channel-accent);
        border-radius: 3px;
        color: var(--channel-accent);
        font-size: 10px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s ease;
    }

    .arrow-key-btn:active {
        background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
    }
}

/* Directory */
.directory {
    position: fixed;
    bottom: 100px;
    right: 10px;
    color: var(--channel-accent);
    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: var(--channel-accent) transparent;
}

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

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

.directory-dropdown::-webkit-scrollbar-thumb {
    background: var(--channel-accent);
    border-radius: 3px;
}

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

.directory-item {
    color: var(--channel-accent);
    font-size: 16px;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid color-mix(in srgb, var(--channel-accent) 20%, transparent);
    transition: background-color 0.2s ease;
}

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

.directory-item:hover {
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

.directory-item:active {
    background: color-mix(in srgb, var(--channel-accent) 20%, transparent);
}

.directory-item.current {
    background: color-mix(in srgb, var(--channel-accent) 15%, transparent);
    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: var(--channel-accent);
    font-size: 18px;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    border-radius: 8px;
    z-index: 350;
}

/* Caveh folder title - centered on same line as age-daily */
.caveh-folder-title {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 18px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    z-index: 350;
    pointer-events: none;
}

/* Caveh film titles below thumbnails */
.caveh-film-title {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    text-align: center;
    padding: 0 4px;
    line-height: 1.2;
}

.caveh-film-year {
    position: absolute;
    bottom: -36px;
    left: 0;
    right: 0;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 12px;
    text-align: center;
    padding: 0 4px;
    line-height: 1.2;
}

/* Make video items with titles have room for the title and year */
.inventory-item.video-item:has(.caveh-film-title) {
    margin-bottom: 44px;
}

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

/* 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;
    background: linear-gradient(to top, black 0%, black 83%, transparent 100%);
    z-index: 100; /* Above video but below UI */
    pointer-events: none;
}

/* Transparent blocker to prevent YouTube player clicks in bottom gap */
.bottom-blocker::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    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;
}

/* Show avatar when channel index is hidden */
.channel-index-overlay.hidden ~ .channel-avatar-container {
    opacity: 1;
    pointer-events: auto;
}

/* Black background only when viewing global channel */
.global-channel-active .channel-index-overlay.visible {
    background: rgba(0, 0, 0, 0.95);
}

/* Transparent background when not on global channel */
.channel-index-overlay.hidden {
    background: transparent;
}

/* FAST LOAD: Mobile-only - black background by default (starts on global channel) */
@media screen and (max-width: 1024px) {
    .channel-index-overlay {
        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 var(--channel-accent);
    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: var(--channel-accent);
    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: var(--channel-accent);
    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;
}

/* 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 {
    display: none;
}

.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;
    }
    
    /* Items flow naturally into all 4 columns */
    .inventory-content .inventory-item {
        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;
}

/* Caveh-specific links row - positioned below channel info */
.caveh-links {
    position: absolute;
    top: 100%;
    right: 0;
    display: none;
    gap: 16px;
    margin-top: 1px;
    pointer-events: auto;
}

/* External link - appears on avatar hover (desktop only) */
.avatar-hover-external-link {
    display: none;
    position: fixed;
    right: 20px;
    color: white;
    font-size: 14px;
    text-align: right;
    text-decoration: underline;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    z-index: 249;
}

/* Custom channel-specific links (e.g., Caveh's TV/Film) */
.channel-info-custom {
    font-size: 12px;
    opacity: 0.8;
    text-decoration: underline;
    cursor: pointer;
    position: relative;
    z-index: 250;
    padding: 8px;
    pointer-events: auto;
}

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

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

/* 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;
}

/* ==================== SHOP OVERLAY ==================== */
.shop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 180;
    display: none;
    pointer-events: none;
}

.shop-overlay.visible {
    display: block;
}

/* Featured book section - positioned left of Age Daily title */
.shop-featured {
    position: absolute;
    top: 60px;
    right: 560px;
    bottom: 120px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    pointer-events: auto;
}

.shop-author-name {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    align-self: flex-start;
    margin-right: 15px;
}

.shop-author-name span {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 120px;
    color: white;
    line-height: 0.9;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.shop-featured-cover {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    height: 85%;
    aspect-ratio: 0.7;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    flex-shrink: 0;
    align-self: flex-start;
    z-index: auto;
}

.shop-featured-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Spread mode - horizontal images cover the right side */
.shop-featured-cover.spread {
    position: fixed;
    top: 60px;
    right: 20px;
    width: auto;
    height: 85%;
    aspect-ratio: auto;
    z-index: 190;
}

.shop-featured-cover.spread img {
    width: auto;
    height: 100%;
    object-fit: contain;
}

/* Hide Age Daily title and author name when spread is showing */
body.shop-spread-mode .global-channel-title {
    display: none !important;
}

body.shop-spread-mode .shop-author-name {
    display: none !important;
}

.shop-featured-info {
    position: absolute;
    bottom: 140px;
    right: 1020px;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.shop-featured-title {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 20px;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.shop-featured-description {
    font-family: Georgia, serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

/* Preview thumbnails */
.shop-preview-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.shop-preview-thumb {
    width: 45px;
    height: 64px;
    background: white;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.shop-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-preview-thumb:hover {
    opacity: 0.9;
}

.shop-preview-thumb.active {
    opacity: 1;
    box-shadow: 0 0 0 2px white, 0 3px 10px rgba(0, 0, 0, 0.4);
}

.shop-buy-link {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 16px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 2px;
    margin-top: 10px;
    align-self: flex-start;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.shop-buy-link:hover {
    border-color: white;
}

.shop-buy-link.disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.7;
    border-bottom-style: dashed;
}

/* Shop tagline - in bottom black bar, aligned with Add to Cart */
.shop-tagline {
    position: absolute;
    bottom: 40px;
    left: calc(100% - 1020px - 220px);
    font-family: Arial, sans-serif;
    font-style: italic;
    font-size: 12px;
    color: white;
    pointer-events: none;
}

/* Shop established - in bottom black bar, aligned with right edge of featured image */
.shop-established {
    position: absolute;
    bottom: 40px;
    right: 560px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: white;
    pointer-events: none;
}

/* Shop A.D. label - in bottom black bar, just right of featured image */
.shop-ad-label {
    position: absolute;
    bottom: 40px;
    left: calc(100% - 555px);
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: white;
    pointer-events: none;
}

/* Hide tagline, established, A.D. label, notice, maintained-by, and contact-email on mobile */
@media screen and (max-width: 768px) {
    .shop-tagline,
    .shop-established,
    .shop-ad-label,
    .shop-notice,
    .maintained-by,
    .contact-email {
        display: none !important;
    }
}

/* Backlist items - positioned below Age Daily title */
.shop-backlist {
    position: absolute;
    top: 50%;
    right: 60px;
    display: flex;
    gap: 30px;
    pointer-events: auto;
}

.shop-backlist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.shop-backlist-cover {
    width: 70px;
    height: 100px;
    background: white;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.shop-backlist-info {
    max-width: 120px;
}

.shop-backlist-title {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 14px;
    color: white;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    margin-bottom: 4px;
}

.shop-backlist-author {
    font-family: Georgia, serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.shop-notice {
    position: absolute;
    bottom: 40px;
    right: 280px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
}

/* Desktop login button (home channel only when not logged in) */
.desktop-login {
    display: none;
    position: fixed;
    bottom: 25px;
    left: 129px;
    z-index: 200;
}

/* Show by default on desktop when on home/global channel */
@media screen and (min-width: 1025px) {
    html.global-channel-active .desktop-login {
        display: block;
    }

    .desktop-login.logged-in {
        display: none;
    }
}

/* Mobile shop overlay */
@media screen and (max-width: 1024px) {
    .shop-featured {
        top: auto;
        bottom: 200px;
        right: 20px;
        left: 20px;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .shop-author-name {
        align-items: center;
        text-align: center;
    }

    .shop-author-name span {
        font-size: 40px;
    }

    .shop-featured-cover {
        width: 180px;
        height: 260px;
    }

    .shop-featured-info {
        text-align: center;
        align-items: center;
    }

    .shop-preview-thumbs {
        justify-content: center;
    }

    .shop-buy-link {
        align-self: center;
    }

    .shop-backlist {
        top: auto;
        bottom: 80px;
        right: 20px;
        left: 20px;
        justify-content: center;
    }

    .shop-backlist-cover {
        width: 50px;
        height: 72px;
    }

    .shop-backlist-info {
        max-width: 80px;
    }

    .shop-backlist-title {
        font-size: 12px;
    }

    .shop-backlist-author {
        font-size: 10px;
    }
}

/* Hide shop on mobile */
@media screen and (max-width: 768px) {
    .shop-overlay,
    .shop-cart,
    .shop-mobile-grid,
    .shop-mobile-expanded,
    .shop-mobile-cart-icon,
    .shop-mobile-cart-overlay {
        display: none !important;
    }
}

/* Hide mobile shop elements on desktop */
.shop-mobile-grid,
.shop-mobile-expanded,
.shop-mobile-cart-icon,
.shop-mobile-cart-overlay {
    display: none;
}

/* Shopping Cart */
.shop-cart {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    max-width: 280px;
    z-index: 1001;
    display: none;
    font-family: Arial, sans-serif;
}

/* Cart visibility is now controlled by JS based on items in cart */

.shop-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.shop-cart-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.shop-cart-items {
    max-height: 200px;
    overflow-y: auto;
}

.shop-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13px;
}

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

.shop-cart-item-name {
    flex: 1;
    margin-right: 10px;
}

.shop-cart-item-remove {
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
}

.shop-cart-item-remove:hover {
    color: white;
}

.shop-cart-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.shop-checkout-btn {
    width: 100%;
    padding: 10px;
    background: white;
    color: black;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.shop-checkout-btn:hover {
    opacity: 0.9;
}

.shop-cart-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-align: center;
    padding: 10px 0;
}

/* Mobile cart adjustments */
@media (max-width: 768px) {
    .shop-cart {
        bottom: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* Folder item styling in inventory grid */
.inventory-item.folder-item {
    background: transparent;
    border: none;
    box-shadow: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-item.folder-item:hover {
    box-shadow: none;
}

.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;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Small play icon in bottom right of thumbnail */
.inventory-item.video-item::before {
    content: "▶";
    position: absolute;
    bottom: 8px;
    right: 8px;
    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;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.inventory-item.movie-item::before {
    content: "▶";
    position: absolute;
    bottom: 8px;
    right: 8px;
    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;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}

.folder-breadcrumb:hover {
    opacity: 1;
    background: transparent;
    box-shadow: none;
}

/* Desktop: All items same size */
@media screen and (min-width: 1025px) {
    .inventory-item.image-item,
    .inventory-item.video-item,
    .inventory-item.movie-item,
    .inventory-item.text-item,
    .inventory-item.pdf-item-large,
    .inventory-item.folder-item,
    .inventory-item.album-item {
        width: 200px;
        height: 200px;
    }

    /* PDF items should be vertically centered (they're smaller) */
    .inventory-item.pdf-item-large {
        align-self: center;
    }
}

/* Mobile: All items same size */
@media screen and (max-width: 1024px) {
    .inventory-item.image-item,
    .inventory-item.video-item,
    .inventory-item.movie-item,
    .inventory-item.text-item,
    .inventory-item.pdf-item-large,
    .inventory-item.folder-item,
    .inventory-item.album-item {
        width: 80px;
        height: 80px;
    }

    /* Hide video/movie labels on mobile */
    .inventory-item.video-item .inventory-item-name,
    .inventory-item.movie-item .inventory-item-name {
        display: none;
    }

    /* PDF items should be vertically centered on mobile too */
    .inventory-item.pdf-item-large {
        align-self: center;
    }
}
/* 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;
    }
}

/* ===== DESKTOP: Avatar Hover Display ===== */
/* Highlight info appears below avatar on hover */
.avatar-hover-highlight {
    display: none;
    position: fixed;
    top: 130px;
    right: 20px;
    color: white;
    font-size: 14px;
    text-align: right;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    z-index: 249;
    max-width: 300px;
}

.avatar-hover-highlight .highlight-label {
    font-weight: normal;
    margin-bottom: 4px;
    color: var(--channel-accent);
}

.avatar-hover-highlight .highlight-title {
    font-weight: bold;
    text-decoration: underline;
    margin-bottom: 2px;
}

.avatar-hover-highlight .highlight-type {
    font-style: italic;
    font-weight: normal;
    opacity: 0.9;
    margin-bottom: 2px;
}

.avatar-hover-highlight .highlight-date-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 12px;
    color: var(--channel-accent);
}

.avatar-hover-highlight .highlight-star {
    font-size: 14px;
}

.avatar-hover-highlight .highlight-date {
    font-weight: normal;
}

.avatar-hover-highlight .highlight-time {
    color: var(--channel-accent);
    font-weight: normal;
}

/* Desktop only - show hover elements */
@media screen and (min-width: 1025px) {
    .avatar-hover-highlight {
        display: block;
    }

    .avatar-hover-external-link {
        display: block;
        top: 280px;
    }

    /* Extend hover zone below avatar to reach external link */
    .channel-avatar-container::after {
        content: '';
        position: fixed;
        top: 20px;
        right: 20px;
        width: 120px;
        height: 280px;
        pointer-events: none;
        z-index: 248;
    }

    .channel-avatar-container:hover::after {
        pointer-events: auto;
    }

    /* Show elements on container hover */
    .channel-avatar-container:hover .avatar-hover-highlight,
    .channel-avatar-container:hover .avatar-hover-external-link {
        opacity: 1;
        pointer-events: auto;
    }

    /* Keep external link visible when hovering it directly */
    .avatar-hover-external-link:hover {
        opacity: 1;
        pointer-events: auto;
    }

    /* Hide hover elements when inventory/index is open or item viewing */
    .channel-avatar-container.item-viewing .avatar-hover-highlight,
    .channel-avatar-container.item-viewing .avatar-hover-external-link,
    .inventory-overlay.visible ~ .channel-avatar-container .avatar-hover-highlight,
    .inventory-overlay.visible ~ .channel-avatar-container .avatar-hover-external-link,
    .channel-index-overlay.visible ~ .channel-avatar-container .avatar-hover-highlight,
    .channel-index-overlay.visible ~ .channel-avatar-container .avatar-hover-external-link {
        display: none !important;
    }
}

/* ============================================================================
   NOTES VIEWING MODE
   ============================================================================ */

.notes-viewing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Same as pocket - above player, below UI controls */
    background: black;
    display: none;
    user-select: text;
    -webkit-user-select: text;
    touch-action: manipulation;
}

.notes-viewing-overlay.active {
    display: block;
}

/* Semi-transparent notes during screening - must be above screening overlay */
.notes-viewing-overlay.screening-active {
    background: rgba(0, 0, 0, 0.85);
    z-index: 99998; /* Above screening overlay (z-index: 6) */
}

/* Hide swipe overlay when notes are active */
.notes-viewing-overlay.active ~ .swipe-overlay,
body:has(.notes-viewing-overlay.active) .swipe-overlay,
.pocket-viewing-overlay.active ~ .swipe-overlay,
body:has(.pocket-viewing-overlay.active) .swipe-overlay {
    pointer-events: none;
}

/* Hide title blocker when pocket viewing is active (especially for PDFs on mobile) */
body:has(.pocket-viewing-overlay.active) .title-blocker {
    display: none;
}

/* Close button */
.notes-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 32px;
    cursor: pointer;
    padding: 10px;
    line-height: 1;
}

.notes-close-btn:hover {
    color: white;
}

/* =========================
   MOBILE: Single Note View
   ========================= */

.notes-mobile-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.notes-mobile-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 25px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* For swipe animations */
    will-change: transform, opacity;
    position: relative;
}

/* Mobile note delete button - positioned relative to the voice memo */
.notes-mobile-delete {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #c83c3c;
    border: 2px solid white;
    color: white;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notes-mobile-delete.visible {
    opacity: 1;
    pointer-events: auto;
}

.notes-mobile-delete:active {
    background: rgba(220, 40, 40, 1);
    transform: scale(0.95);
}

/* Selected state for mobile voice notes - subtle highlight on inner content */
.notes-mobile-voice.selected .notes-mobile-voice-word,
.notes-mobile-audio-only.selected .notes-mobile-audio-icon {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Text note on mobile - matches pocket-text-content styling */
.notes-mobile-text {
    max-width: 800px;
    max-height: 90vh;
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.7;
    text-align: center;
    padding: 20px;
}

/* Editable mobile note styling */
.notes-mobile-text[contenteditable="true"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.notes-mobile-text[contenteditable="true"]:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

/* Image note on mobile */
.notes-mobile-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}

.notes-mobile-image img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    filter: grayscale(1) contrast(1.2) invert(1);
}

/* Voice note on mobile - single word display */
.notes-mobile-voice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    position: relative;
}

/* Date and duration label */
.notes-mobile-voice-label {
    color: rgba(255, 255, 255, 0.5);
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin-bottom: 30px;
    text-align: center;
}

.notes-mobile-voice-word {
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 48px;
    font-weight: 400;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.1s ease;
    text-align: center;
    padding: 0 20px;
}

.notes-mobile-voice-controls {
    margin-top: 40px;
    display: flex;
    gap: 20px;
}

.notes-voice-play-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 10px;
}

.notes-voice-play-btn:hover {
    opacity: 0.8;
}

/* Navigation indicator */
.notes-mobile-nav {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.notes-nav-indicator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-style: italic;
}

/* Note date display */
.notes-date {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
}

/* =========================
   DESKTOP: Islands Layout
   ========================= */

.notes-desktop-view {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto; /* Enable both horizontal and vertical scroll */
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation; /* Allow scroll and pinch-zoom */
    cursor: grab; /* Show grab cursor for drag navigation */
}

.notes-desktop-view.grabbing {
    cursor: grabbing;
    user-select: none;
}

/* For non-owners, images should allow grab-to-pan through them */
.notes-desktop-view:not(.owner-mode) .notes-island-image img {
    pointer-events: none;
}

.notes-desktop-scroll {
    min-width: 100%;
    width: max-content; /* Expand to fit positioned content */
    padding: 40px 200px 50vh 200px; /* Extra horizontal padding for off-screen items */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100%;
    -webkit-font-smoothing: subpixel-antialiased;
    touch-action: manipulation; /* Allow scroll and pinch-zoom */
}

/* When notes has content, add top padding for first note */
.notes-desktop-scroll .notes-island:first-child {
    margin-top: 35vh;
}

/* Each note is an "island" - spaced apart */
.notes-island {
    margin-bottom: 60px;
    width: 100%;
    text-align: center;
    position: relative;
}

/* Image notes go below text/voice notes */
.notes-island.notes-island-type-image {
    z-index: 1;
}

.notes-island.notes-island-type-text,
.notes-island.notes-island-type-voice {
    z-index: 10;
}

/* First note gets more space below to feel isolated */
.notes-island:first-child {
    margin-bottom: 150px;
}

.notes-island:last-child {
    margin-bottom: 0;
}

/* Text note island - matches pocket-text-content */
.notes-island-text {
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.7;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    text-align: center;
    display: inline-block;
    max-width: 100%;
}

/* Editable note styling for owners */
.notes-island-text[contenteditable="true"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 10px;
    margin: -10px;
}

.notes-island-text[contenteditable="true"]:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    padding: 10px;
    margin: -10px;
}

/* Image note on desktop */
.notes-island-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.notes-island-image img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    filter: grayscale(1) contrast(1.2) invert(1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Image filter - currently disabled to show normal colors */
.notes-image-inverted {
    /* filter: invert(1) brightness(1.1); */
    /* mix-blend-mode: screen; */
}

/* Draggable image notes (owner mode) */
.notes-image-draggable {
    cursor: grab;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.notes-image-draggable:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.notes-image-draggable:active {
    cursor: grabbing;
}

/* Resize handle - bottom right corner */
.notes-image-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.notes-image-resize-handle::before {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
}

.notes-image-draggable:hover .notes-image-resize-handle {
    opacity: 1;
}

/* Image caption */
.notes-image-caption {
    color: rgba(255, 255, 255, 0.7);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    font-style: italic;
    margin-top: 15px;
    text-align: center;
}

/* Empty state styling - both positioned consistently */
.notes-empty-state,
.pocket-empty-state {
    color: rgba(255, 255, 255, 0.4);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-style: italic;
    text-align: center;
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

/* Notes empty state needs special positioning since its parent has width: max-content */
.notes-empty-state {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
}

/* Draggable text notes (owner mode) */
.notes-text-draggable {
    cursor: grab;
    position: relative;
}

.notes-text-draggable:active {
    cursor: grabbing;
}

/* Draggable voice notes (owner mode) */
.notes-voice-draggable {
    cursor: grab;
}

.notes-voice-draggable:active {
    cursor: grabbing;
}

/* Voice note island */
.notes-island-voice {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 400px;
    max-width: 90vw;
}

/* Audio box - consistent for all voice memos (with or without transcription) */
.notes-island-audio-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notes-island-audio-box:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Waveform player area - shows animated bars and subtitle overlay during playback */
.notes-island-waveform {
    position: relative;
    flex: 1;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.notes-waveform-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 70px;
    padding: 0 10px;
}

.notes-waveform-bar {
    width: 3px;
    min-height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
    transition: height 0.05s ease;
}

.notes-waveform-subtitle {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    text-align: center;
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    pointer-events: none;
}

.notes-waveform-subtitle.visible {
    opacity: 1;
}

.subtitle-word-active {
    color: #fff;
    font-weight: 600;
}

/* Progress bar for audio playback */
.notes-progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 8px 8px;
}

.notes-progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0 0 0 8px;
    width: 0%;
    transition: width 0.1s linear;
}

.notes-island-transcription {
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.9;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    flex: 1;
}

/* Individual word spans for highlighting */
.notes-word {
    transition: background-color 0.1s ease, color 0.1s ease;
    padding: 2px 0;
    border-radius: 2px;
}

.notes-word.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.notes-word.past {
    color: rgba(255, 255, 255, 0.6);
}

/* Play button for desktop voice notes */
.notes-island-play {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    padding-top: 6px;
}

.notes-island-play-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
}

.notes-island-play-btn:hover {
    color: white;
}

.notes-island-play-btn.playing {
    color: white;
}

.notes-island-duration {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-family: Arial, sans-serif;
}

/* Island date */
.notes-island-date {
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
}

/* Note delete button - appears on hover, positioned inside transformed container */
.note-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(200, 60, 60, 0.9);
    border: 2px solid white;
    color: white;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notes-island {
    position: relative;
}

/* Containers that hold delete button need position: relative */
/* Z-index: images below text/audio for collage layering */
.notes-island-image {
    position: relative;
    z-index: 1;
}

.notes-island-text-wrapper,
.notes-island-voice {
    position: relative;
    z-index: 10;
}

/* Text wrapper inherits text styling */
.notes-island-text-wrapper {
    max-width: 800px;
}

.notes-island:hover .note-delete-btn,
.notes-island-image:hover .note-delete-btn,
.notes-island-text-wrapper:hover .note-delete-btn,
.notes-island-voice:hover .note-delete-btn {
    opacity: 1;
}

.note-delete-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

/* Edit button - minimalist text button at bottom-right, only shows when selected */
.note-edit-btn {
    display: block;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 8px;
    text-align: right;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, color 0.2s ease;
}

/* Only show edit button when item is selected */
.notes-island-text-wrapper.selected .note-edit-btn,
.notes-island-voice.selected .note-edit-btn {
    opacity: 1;
    pointer-events: auto;
}

.note-edit-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Audio-only notes (no transcription) - Desktop */
.notes-island-audio-only {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notes-island-audio-only:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notes-audio-play-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    order: 1;
}

.notes-audio-play-btn:hover,
.notes-audio-play-btn.playing {
    color: white;
}

.notes-audio-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    min-width: 160px;
    max-width: 220px;
}

.notes-audio-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-family: Arial, sans-serif;
    line-height: 1.4;
}

.notes-audio-duration {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-family: Arial, sans-serif;
}

/* Audio-only notes - Mobile */
.notes-mobile-audio-only {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: auto;
    height: auto;
    cursor: pointer;
    position: relative;
    padding: 30px;
}

.notes-mobile-audio-icon {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
}

.notes-mobile-audio-icon.playing {
    color: white;
}

.notes-mobile-audio-title {
    color: white;
    font-size: 24px;
    font-family: Georgia, 'Times New Roman', serif;
    text-align: center;
}

.notes-mobile-audio-duration {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-family: Arial, sans-serif;
}

/* Responsive: Show scroll view on both mobile and desktop */
.notes-mobile-view {
    display: none !important;
}
.notes-desktop-view {
    display: block;
}

/* Mobile adjustments - simple vertical stacking, no collage */
@media screen and (max-width: 768px) {
    .notes-desktop-view {
        overflow-y: auto;
        overflow-x: hidden; /* No horizontal scroll on mobile */
        cursor: auto; /* No grab cursor on mobile */
    }

    .notes-desktop-scroll {
        padding: 0 0 50vh 0; /* No horizontal padding - full width */
        width: 100%;
        min-width: unset;
        align-items: stretch; /* Full width items */
    }

    .notes-desktop-scroll .notes-island:first-child {
        margin-top: 140px; /* Below avatar area */
    }

    /* First item text needs to be centered on screen */
    .notes-desktop-scroll .notes-island.notes-island-type-text:first-child {
        margin-top: 35vh;
    }

    .notes-island {
        margin-bottom: 2px; /* Very close stacking for images */
        width: 100%;
        text-align: center;
    }

    /* Text items need more space to appear centered/isolated */
    .notes-island.notes-island-type-text {
        margin-top: 30vh;
        margin-bottom: 30vh;
    }

    /* But consecutive text items shouldn't double up margins */
    .notes-island.notes-island-type-text + .notes-island.notes-island-type-text {
        margin-top: 0;
    }

    /* Voice memo subtitle - center of screen on mobile */
    .notes-waveform-subtitle {
        position: fixed;
        top: 50%;
        left: 10%;
        right: 10%;
        bottom: auto;
        transform: translateY(-50%);
        font-size: 20px;
    }

    /* Remove transforms on mobile - no collage positioning */
    .notes-island-image,
    .notes-island-text-wrapper,
    .notes-island-voice {
        transform: none !important;
        width: 100% !important;
        max-width: 100%;
    }

    .notes-island-image {
        margin: 0;
        width: auto !important;
        height: auto !important;
    }

    .notes-island-image img {
        width: 100%;
        max-width: 100%;
        height: auto !important;
        max-height: none;
        display: block; /* Remove any inline spacing */
    }

    /* Hide resize handle on mobile - no resizing in stack view */
    .notes-image-resize-handle {
        display: none !important;
    }

    /* Disable dragging classes on mobile */
    .notes-image-draggable,
    .notes-text-draggable,
    .notes-voice-draggable {
        cursor: auto;
    }

    /* Delete button on mobile - simple white X, no background */
    .note-delete-btn {
        right: 10px;
        top: 10px;
        width: auto;
        height: auto;
        background: none;
        border: none;
        border-radius: 0;
        color: white;
        font-size: 24px;
        opacity: 0;
        pointer-events: none;
    }

    /* Only show delete button when item is selected */
    .notes-island.selected .note-delete-btn {
        opacity: 1;
        pointer-events: auto;
    }

    /* Disable hover-based showing on mobile */
    .notes-island:hover .note-delete-btn,
    .notes-island-image:hover .note-delete-btn,
    .notes-island-text-wrapper:hover .note-delete-btn,
    .notes-island-voice:hover .note-delete-btn {
        opacity: 0;
        pointer-events: none;
    }

    .notes-island.selected:hover .note-delete-btn {
        opacity: 1;
        pointer-events: auto;
    }

    /* Mobile edit button - only visible when selected */
    .note-edit-btn {
        font-size: 14px;
        padding: 8px 0;
    }

    .notes-island-text-wrapper.selected .note-edit-btn,
    .notes-island-voice.selected .note-edit-btn {
        opacity: 1;
        pointer-events: auto;
    }

    .notes-island-text {
        font-size: 17px;
        padding: 0 10px;
    }

    .notes-island-transcription {
        font-size: 17px;
    }
}

/* Channel info notes link styling (matches pocket link) */
.channel-info-notes {
    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;
    color: white;
}

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

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

/* ============================================================================
   OWNER MODE - Add buttons and editor
   ============================================================================ */

/* Circular add button (+ in circle) - matches nav button style */
.owner-add-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s ease;
}

.owner-add-btn:hover {
    border-color: white;
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.owner-add-btn span {
    line-height: 1;
    margin-top: -2px;
}

/* Notes image button - positioned to the right of the add note button */
.notes-image-btn {
    left: calc(50% + 70px) !important;
}

.notes-image-btn svg {
    stroke: currentColor;
}

/* Owner Buttons - quill, rec, and pocket add */
/* Desktop: bottom center. Mobile: top-left opposite avatar */
.owner-buttons {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 250;
}

/* Mobile: position top-left opposite avatar */
@media screen and (max-width: 768px) {
    .owner-buttons {
        bottom: auto;
        top: 60px;
        left: 20px;
        transform: none;
        gap: 12px;
    }

    .owner-btn {
        width: 38px;
        height: 38px;
    }

    .owner-btn.quill svg {
        width: 16px;
        height: 16px;
    }

    .owner-btn.rec .rec-dot {
        width: 14px;
        height: 14px;
    }

    .owner-btn.add-pocket span {
        font-size: 20px;
    }

    .owner-btn.image-note svg {
        width: 16px;
        height: 16px;
    }

    .owner-btn.settings svg {
        width: 16px;
        height: 16px;
    }
}

.owner-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Quill button - accent circle outline with quill icon */
.owner-btn.quill {
    border: 2px solid var(--channel-accent);
    opacity: 0.7;
}

.owner-btn.quill svg {
    width: 20px;
    height: 20px;
    stroke: var(--channel-accent);
}

.owner-btn.quill:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

.owner-btn.quill:hover svg {
    stroke: var(--channel-accent);
}

/* Rec button - iPhone Voice Memo style */
.owner-btn.rec {
    border: 2px solid var(--channel-accent);
    opacity: 0.7;
}

.owner-btn.rec .rec-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--channel-accent);
    transition: all 0.3s ease;
}

.owner-btn.rec:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

.owner-btn.rec:hover .rec-dot {
    background: var(--channel-accent);
}

/* Recording state - small square-ish dot */
.owner-btn.rec.recording {
    opacity: 1;
    border-color: var(--channel-accent);
}

.owner-btn.rec.recording .rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--channel-accent);
}

/* Add pocket button - just a + sign, no circle */
.owner-btn.add-pocket {
    border: none;
    width: auto;
    height: auto;
    padding: 5px 10px;
}

.owner-btn.add-pocket span {
    font-size: 28px;
    font-weight: 300;
    color: var(--channel-accent);
    opacity: 0.8;
    line-height: 1;
}

.owner-btn.add-pocket:hover span {
    opacity: 1;
}

/* Settings button */
.owner-btn.settings {
    border: none;
    opacity: 0.7;
}

.owner-btn.settings svg {
    width: 20px;
    height: 20px;
    stroke: var(--channel-accent);
}

.owner-btn.settings:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

/* Image note button - for ink drawings (only shown to users with canUploadNoteImages permission) */
.owner-btn.image-note {
    border: 2px solid var(--channel-accent);
    opacity: 0.7;
}

.owner-btn.image-note svg {
    width: 20px;
    height: 20px;
    stroke: var(--channel-accent);
}

.owner-btn.image-note:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--channel-accent) 10%, transparent);
}

.owner-btn.image-note:hover svg {
    stroke: var(--channel-accent);
}

/* Uploaded message - fades in/out */
.uploaded-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.uploaded-message.visible {
    opacity: 1;
}

/* Transcribe prompt - Yes/No buttons after upload */
.transcribe-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.transcribe-prompt.visible {
    opacity: 1;
    pointer-events: auto;
}

.transcribe-prompt-text {
    color: white;
    font-size: 22px;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.transcribe-prompt-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.transcribe-btn {
    padding: 10px 30px;
    font-size: 16px;
    font-family: Arial, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: white;
}

.transcribe-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.transcribe-btn.transcribe-yes {
    background: rgba(255, 255, 255, 0.15);
}

.transcribe-btn.transcribe-yes:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Playback waveform overlay - shows during voice note playback */
.playback-waveform-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    z-index: 50;
}

.playback-waveform-overlay.active {
    display: block;
}

.playback-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    padding: 0 10%;
    box-sizing: border-box;
}

.playback-waveform .bar {
    flex: 1;
    max-width: 6px;
    min-width: 2px;
    background: var(--channel-accent);
    border-radius: 2px;
    transition: height 0.05s ease;
}

/* Subtitle overlay on playback waveform */
.playback-subtitle {
    position: absolute;
    bottom: 15%;
    left: 10%;
    right: 10%;
    text-align: center;
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    line-height: 1.5;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.playback-subtitle.visible {
    opacity: 1;
}

.playback-subtitle .subtitle-word-active {
    color: var(--channel-accent);
    font-weight: 600;
}

/* Mobile subtitle overlay - just centered text, no waveform */
.mobile-subtitle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
}

.mobile-subtitle-overlay.active {
    display: flex;
}

.mobile-subtitle {
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 48px;
    font-weight: 400;
    text-align: center;
    padding: 20px 40px;
    max-width: 90%;
    line-height: 1.3;
}

/* Recording overlay - shows waveform over player */
.recording-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.recording-overlay.active {
    display: flex;
}

.recording-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 0 10%;
    box-sizing: border-box;
}

.recording-waveform .bar {
    flex: 1;
    max-width: 6px;
    min-width: 2px;
    background: var(--channel-accent);
    border-radius: 2px;
    transition: height 0.05s ease;
}

.recording-timer {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
}

.recording-controls {
    margin-top: 40px;
    display: flex;
    gap: 30px;
    align-items: center;
}

.recording-stop-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--channel-accent);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.recording-stop-btn:hover {
    background: color-mix(in srgb, var(--channel-accent) 20%, transparent);
}

.recording-stop-btn .stop-icon {
    width: 20px;
    height: 20px;
    background: var(--channel-accent);
    border-radius: 3px;
}

.recording-options {
    position: absolute;
    bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.recording-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.recording-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--channel-accent);
}

.recording-option.transcribe-option {
    cursor: pointer;
}

.recording-option.transcribe-option:hover {
    color: rgba(255, 255, 255, 0.9);
}

.recording-limit-warning {
    color: var(--channel-accent);
    font-size: 14px;
    margin-top: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recording-limit-warning.visible {
    opacity: 1;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--channel-accent); }
    50% { border-color: color-mix(in srgb, var(--channel-accent) 50%, transparent); }
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.7; }
}

/* Hide on mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .owner-buttons {
        display: none !important;
    }
}

/* Note Editor Overlay */
.note-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.note-editor-overlay.active {
    display: flex;
}

.note-editor-container {
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}

.note-editor-container textarea {
    width: 100%;
    min-height: 200px;
    padding: 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.7;
    resize: vertical;
    box-sizing: border-box;
}

.note-editor-container textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

.note-editor-container textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Upload options in note editor */
.note-editor-upload-options {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.note-editor-upload-option {
    flex: 1;
    padding: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    text-align: center;
}

.note-editor-upload-option input[type="file"] {
    display: none;
}

.note-editor-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    transition: color 0.2s ease;
}

.note-editor-upload-label:hover {
    color: rgba(255, 255, 255, 0.9);
}

.note-editor-upload-icon {
    font-size: 18px;
}

.note-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.note-editor-cancel,
.note-editor-save {
    padding: 10px 24px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

.note-editor-cancel {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.note-editor-cancel:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
}

.note-editor-save {
    background: white;
    color: black;
}

.note-editor-save:hover {
    background: rgba(255, 255, 255, 0.9);
}

.note-editor-save:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.settings-overlay.active {
    display: flex;
}

.settings-container {
    width: 90%;
    max-width: 500px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-header h2 {
    color: var(--channel-accent);
    font-size: 18px;
    font-weight: normal;
    margin: 0;
    text-transform: lowercase;
}

.settings-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
}

.settings-close:hover {
    opacity: 1;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-field label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-transform: lowercase;
}

.settings-field input[type="text"] {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px;
    font-size: 14px;
    border-radius: 4px;
}

.settings-field input[type="text"]:focus {
    outline: none;
    border-color: var(--channel-accent);
}

.settings-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
}

.settings-avatar-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.settings-avatar-row input {
    flex: 1;
}

.settings-avatar-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--channel-accent);
    object-fit: cover;
    display: none;
}

.settings-avatar-preview.visible {
    display: block;
}

.settings-color-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.settings-color-row input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.settings-color-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.settings-color-row input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.settings-color-hex {
    color: white;
    font-family: monospace;
    font-size: 14px;
}

.settings-color-reset {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
}

.settings-color-reset:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.settings-external-link-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.settings-external-link-row select {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
}

.settings-external-link-row select:focus {
    outline: none;
    border-color: var(--channel-accent, red);
}

.settings-external-link-row select option {
    background: #1a1a1a;
    color: white;
}

.settings-external-link-row input {
    flex: 1;
}

.settings-error {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 4px;
}

.settings-avatar-upload-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.settings-avatar-upload-btn:hover {
    border-color: var(--preview-accent, var(--channel-accent));
    color: white;
}

.settings-avatar-upload-btn.uploading {
    opacity: 0.6;
    cursor: wait;
}

.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 12px;
}

.settings-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.settings-cancel:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.settings-save {
    background: var(--channel-accent);
    border: none;
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.settings-save:hover {
    opacity: 0.9;
}

/* Pocket Add Button - positioned inside inventory overlay */
.owner-add-btn.pocket-add {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

/* Pocket Uploader Overlay */
.pocket-uploader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.pocket-uploader-overlay.active {
    display: flex;
}

.pocket-uploader-container {
    width: 90%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.pocket-uploader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pocket-uploader-header h2 {
    color: white;
    font-size: 20px;
    font-weight: normal;
    margin: 0;
}

.pocket-uploader-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.pocket-uploader-close:hover {
    color: white;
}

.pocket-uploader-types {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.pocket-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 25px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pocket-type-btn:hover,
.pocket-type-btn.selected {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

.pocket-type-icon {
    font-size: 28px;
    color: rgba(255, 255, 255, 0.7);
}

.pocket-type-icon svg {
    stroke: rgba(255, 255, 255, 0.7);
}

.pocket-type-btn:hover .pocket-type-icon svg,
.pocket-type-btn.selected .pocket-type-icon svg {
    stroke: white;
}

.pocket-type-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.pocket-type-btn:hover .pocket-type-label,
.pocket-type-btn.selected .pocket-type-label {
    color: white;
}

.pocket-uploader-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pocket-input {
    width: 100%;
    padding: 12px 15px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 16px;
    border-radius: 4px;
    box-sizing: border-box;
}

.pocket-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

.pocket-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.pocket-uploader-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 10px;
}

.pocket-uploader-cancel,
.pocket-uploader-save {
    padding: 10px 24px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
}

.pocket-uploader-cancel {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pocket-uploader-cancel:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.6);
}

.pocket-uploader-save {
    background: white;
    color: black;
}

.pocket-uploader-save:hover {
    background: rgba(255, 255, 255, 0.9);
}

.pocket-uploader-save:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* Or divider */
.pocket-or-divider {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    text-align: center;
    margin: 10px 0;
}

/* Helper text */
.pocket-helper-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    display: block;
    margin-top: 8px;
}

/* Preview area */
.pocket-preview {
    margin-top: 10px;
}

/* Album images preview grid */
.album-images-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.album-images-preview .album-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.album-images-preview .album-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-images-preview .album-preview-item .album-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.album-images-preview .album-preview-item:hover .album-preview-remove {
    opacity: 1;
}

.album-images-count {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile styles for pocket uploader and note editor */
@media screen and (max-width: 768px) {
    .pocket-uploader-container {
        width: 95%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
        padding: 15px;
    }

    .pocket-uploader-types {
        flex-wrap: wrap;
        gap: 10px;
    }

    .pocket-type-btn {
        flex: 1 1 45%;
        padding: 15px 10px;
    }

    .pocket-input {
        font-size: 16px; /* Prevents iOS zoom */
    }

    .note-editor-container {
        width: 90%;
        max-width: calc(100vw - 40px);
        max-height: 90vh;
        overflow-y: auto;
        padding: 15px;
        box-sizing: border-box;
    }

    .note-editor-container textarea {
        min-height: 150px;
        font-size: 16px; /* Prevents iOS zoom */
        width: 100%;
        box-sizing: border-box;
    }

    .note-editor-upload-options {
        flex-direction: column;
        width: 100%;
    }

    .note-editor-upload-option {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Album Viewer - for viewing albums in pocket */
.pocket-album-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1; /* Keep below fixed buttons */
}

.pocket-album-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

.pocket-album-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Tap zones for mobile album navigation */
.album-tap-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    z-index: 10;
    cursor: pointer;
}

.album-tap-left {
    left: 0;
}

.album-tap-right {
    right: 0;
}

.pocket-album-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
}

.pocket-album-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pocket-album-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.pocket-album-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

/* Mobile: swipe navigation for albums */
@media (max-width: 768px) {
    .pocket-album-nav {
        padding: 10px;
        gap: 15px;
    }

    .pocket-album-nav-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .pocket-album-image-container {
        padding: 10px;
    }
}

/* Album edit button in viewer nav */
.pocket-album-edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.pocket-album-edit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Desktop Album Scroll View - continuous vertical scroll through all images */
.pocket-album-scroll-viewer {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.album-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.album-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.album-scroll-image-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
}

.album-scroll-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}

.album-scroll-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 100;
}

/* Album Grid View - shows thumbnails before enhanced view */
.pocket-album-grid {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pocket-album-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pocket-album-grid-title {
    font-size: 18px;
    font-weight: 500;
    color: white;
}

.pocket-album-grid-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

.pocket-album-grid-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 20px;
    overflow-y: auto;
    align-content: start;
}

.pocket-album-grid-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: visible;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.pocket-album-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.pocket-album-grid-item:hover {
    transform: scale(1.05);
}

/* Delete button in album grid - matches pocket grid delete style */
.pocket-album-grid-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(200, 60, 60, 0.9);
    border: 2px solid white;
    color: white;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10;
}

.pocket-album-grid-item:hover .pocket-album-grid-delete {
    opacity: 1;
}

.pocket-album-grid-delete:hover {
    background: rgba(220, 40, 40, 1);
    transform: scale(1.1);
}

/* Back to grid button in enhanced album view */
.pocket-album-back-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    z-index: 5;
}

.pocket-album-back-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Mobile adjustments for album grid */
@media (max-width: 768px) {
    .pocket-album-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
        padding: 12px;
    }

    .pocket-album-grid-header {
        padding: 12px 15px;
    }

    .pocket-album-grid-title {
        font-size: 16px;
    }

    .pocket-album-grid-delete {
        opacity: 1; /* Always show on mobile */
    }

    .pocket-album-back-btn {
        top: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Album Editor Overlay */
.album-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 20;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.album-editor-overlay.active {
    display: flex;
}

.album-editor-container {
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.album-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.album-editor-header h2 {
    margin: 0;
    font-size: 18px;
    color: white;
    font-weight: 500;
}

.album-editor-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.album-editor-close:hover {
    color: white;
}

.album-editor-hint {
    margin: 0;
    padding: 12px 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.album-editor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 20px 20px;
    overflow-y: auto;
    flex: 1;
}

.album-editor-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
}

.album-editor-item:active {
    cursor: grabbing;
}

.album-editor-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-editor-item-num {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.album-editor-item.dragging {
    opacity: 0.3;
    transform: scale(0.95);
}

.album-editor-item.drag-over {
    border-color: #4a9eff;
    transform: scale(1.05);
}

.album-editor-ghost {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.album-editor-ghost img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.album-editor-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.album-editor-cancel:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.album-editor-save {
    background: #4a9eff;
    border: none;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.album-editor-save:hover {
    background: #3a8eef;
}

.album-editor-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive album editor */
@media (max-width: 768px) {
    .album-editor-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .album-editor-container {
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .album-editor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Upload button */
.pocket-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pocket-upload-btn:hover {
    border-color: white;
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.pocket-upload-btn svg {
    stroke: currentColor;
}

.pocket-upload-btn-small {
    width: auto;
    padding: 10px 16px;
    font-size: 13px;
}

/* File uploaded indicator */
.pocket-file-uploaded {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.pocket-file-name {
    word-break: break-all;
}

/* Thumbnail section */
.pocket-thumbnail-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pocket-thumbnail-section label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-bottom: 10px;
}

/* =========================
   SCREENING OVERLAY
   Synchronized movie screenings
   ========================= */

.screening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 6; /* Above pocket overlay */
    background: black;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screening-overlay.hidden {
    display: none;
}

/* Countdown state */
.screening-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.screening-countdown.hidden {
    display: none;
}

.screening-countdown-title {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.screening-countdown-channel {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 50px;
}

.screening-countdown-timer {
    font-size: 80px;
    font-weight: 200;
    font-variant-numeric: tabular-nums;
    letter-spacing: 4px;
    color: white;
}

.screening-countdown-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 20px;
}

.screening-waiting-for {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 30px;
}

.screening-waiting-for:empty {
    display: none;
}

/* Voice chat during countdown */
.screening-voice-chat {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
}

.voice-chat-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.voice-chat-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.voice-chat-btn.muted {
    background: rgba(255, 100, 100, 0.2);
    border-color: rgba(255, 100, 100, 0.4);
}

.voice-chat-btn.muted .voice-icon::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 24px;
    background: rgba(255, 100, 100, 0.8);
    transform: rotate(45deg);
}

.voice-icon {
    font-size: 20px;
    position: relative;
}

.voice-chat-participants {
    display: flex;
    gap: 8px;
}

.voice-participant {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.15s ease;
}

.voice-participant.speaking {
    background: rgba(100, 255, 150, 0.8);
    box-shadow: 0 0 8px rgba(100, 255, 150, 0.5);
}

.voice-chat-joining {
    font-family: 'Times New Roman', Times, serif;
    font-style: italic;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* Live playback state */
.screening-live {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screening-live.hidden {
    display: none;
}

.screening-video {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Ended state */
.screening-ended {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.screening-ended.hidden {
    display: none;
}

.screening-ended-title {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.6);
}

.screening-ended-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
}

/* Viewer count - minimal, bottom left */
.screening-viewer-count {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: none; /* Hidden by default, shown when screening active */
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    z-index: 100; /* Above screening overlay content */
    transition: opacity 0.3s ease;
}

/* Show viewer count when screening overlay is active (not hidden) */
.screening-overlay:not(.hidden) .screening-viewer-count {
    display: flex;
}

.viewer-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    animation: viewer-pulse 1.5s infinite;
}

@keyframes viewer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Fullscreen button - bottom right, minimal */
.screening-fullscreen-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
    z-index: 99999;
    transition: opacity 0.2s ease;
    opacity: 0.7;
    pointer-events: auto !important;
}

.screening-fullscreen-btn:hover {
    opacity: 1;
}

.screening-fullscreen-btn svg {
    display: block;
    width: 28px;
    height: 28px;
}

/* Now Playing indicator - upper left */
.screening-now-playing {
    position: fixed;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 14px;
    font-family: Arial, sans-serif;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.screening-now-playing span {
    font-style: italic;
}

/* Hide UI when fullscreen */
.screening-overlay:fullscreen .screening-fullscreen-btn,
.screening-overlay:-webkit-full-screen .screening-fullscreen-btn {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screening-overlay:fullscreen:hover .screening-fullscreen-btn,
.screening-overlay:-webkit-full-screen:hover .screening-fullscreen-btn {
    opacity: 1;
}

.screening-overlay:fullscreen .screening-viewer-count,
.screening-overlay:-webkit-full-screen .screening-viewer-count {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screening-overlay:fullscreen:hover .screening-viewer-count,
.screening-overlay:-webkit-full-screen:hover .screening-viewer-count {
    opacity: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .screening-countdown-title {
        font-size: 22px;
        padding: 0 20px;
    }

    .screening-countdown-timer {
        font-size: 48px;
    }

    .screening-fullscreen-btn {
        bottom: 70px; /* Above mobile controls */
        right: 15px;
    }

    .screening-viewer-count {
        bottom: 70px;
        left: 15px;
    }
}

/* Channel info screening display */
.channel-screening-info {
    font-size: 13px;
    color: white;
    font-weight: bold;
    margin-top: 8px;
    line-height: 1.4;
}

/* Fixed screening countdown - upper left corner */
.screening-countdown-fixed {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.screening-countdown-fixed.waiting {
    color: rgba(241, 196, 15, 0.9);
}

/* Screening action links (edit | cancel) */
.channel-screening-actions {
    font-size: 12px;
    margin-top: 4px;
    pointer-events: auto;
}

.channel-screening-edit {
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.channel-screening-edit:hover {
    color: white;
    text-decoration: underline;
}

.channel-screening-divider {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 6px;
}

.channel-screening-cancel {
    color: rgba(255, 100, 100, 0.8);
    cursor: pointer;
}

.channel-screening-cancel:hover {
    color: rgba(255, 100, 100, 1);
    text-decoration: underline;
}

/* Edit Screening Modal */
.edit-screening-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.edit-screening-content {
    background: #1a1a1a;
    padding: 24px;
    border-radius: 12px;
    min-width: 280px;
}

.edit-screening-content h3 {
    margin: 0 0 20px 0;
    color: white;
    font-size: 18px;
}

.edit-screening-field {
    margin-bottom: 16px;
}

.edit-screening-field label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-bottom: 6px;
}

.edit-screening-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.edit-screening-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.edit-screening-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    color: black;
}

.edit-screening-buttons button.cancel-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ============================================
   THUMBPRINT LOGIN
   ============================================ */

/* Thumbprint Login Icon - Mobile Only */
.thumbprint-login {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 310px;
    width: 54px;
    height: 54px;
    z-index: 1000;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

@media screen and (max-width: 1024px) and (orientation: portrait) {
    .thumbprint-login {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.thumbprint-icon {
    width: 42px;
    height: 42px;
    fill: var(--channel-accent);
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
}

.thumbprint-login:active .thumbprint-icon,
.thumbprint-login.pressing .thumbprint-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Scanning animation ring */
.thumbprint-scanning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    border: 2px solid transparent;
    border-radius: 50%;
    pointer-events: none;
}

.thumbprint-scanning.active {
    border-color: var(--channel-accent);
    animation: thumbprint-scan 1.5s ease-in-out forwards;
}

@keyframes thumbprint-scan {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
        border-color: var(--channel-accent);
    }
    20% {
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
        border-color: rgba(0, 255, 0, 0.8);
    }
}

.thumbprint-scanning.success {
    animation: thumbprint-success 0.5s ease-out forwards;
}

@keyframes thumbprint-success {
    0% {
        transform: translate(-50%, -50%) scale(1);
        border-color: rgba(0, 255, 0, 0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        border-color: rgba(0, 255, 0, 0);
        opacity: 0;
    }
}

/* Note: thumbprint is always visible on mobile, shows sign-out when logged in */

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.login-overlay.active {
    display: flex;
}

.login-container {
    width: 90%;
    max-width: 400px;
    padding: 30px;
}

.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.login-header h2 {
    color: red;
    font-size: 18px;
    font-weight: normal;
    margin: 0;
}

.login-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
}

.login-close:hover {
    opacity: 1;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-bottom: 8px;
}

.login-field input {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 16px;
    border-radius: 4px;
    box-sizing: border-box;
}

.login-field input:focus {
    outline: none;
    border-color: red;
}

.login-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
}

.login-error.visible {
    display: block;
}

.login-success {
    color: #4ade80;
    font-size: 13px;
    margin-bottom: 15px;
    display: none;
}

.login-success.visible {
    display: block;
}

.login-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.login-cancel {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
}

.login-cancel:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.login-submit {
    flex: 1;
    background: red;
    border: none;
    color: white;
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
}

.login-submit:hover {
    background: #cc0000;
}

.login-submit:disabled {
    background: rgba(255, 0, 0, 0.4);
    cursor: not-allowed;
}

/* Sign-out overlay - uses owner's accent color */
#signOutOverlay .login-header h2 {
    color: var(--owner-accent, red);
}

#signOutOverlay .login-submit {
    background: var(--owner-accent, red);
}

#signOutOverlay .login-submit:hover {
    filter: brightness(0.85);
}

.signout-message {
    text-align: center;
    padding: 20px 0;
}

.signout-message p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 10px 0;
}

.signout-message span {
    color: var(--owner-accent, red);
    font-weight: 500;
}

/* Hide thumbprint when overlays are open */
body:has(.notes-viewing-overlay.active) .thumbprint-login,
body:has(.pocket-viewing-overlay.active) .thumbprint-login,
body:has(.login-overlay.active) .thumbprint-login {
    display: none !important;
}

/* ============================================================================
   ONBOARDING MESSAGES - New user welcome messages
   ============================================================================ */

.onboarding-message {
    position: fixed;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.onboarding-message.visible {
    opacity: 1;
}

/* Desktop: Times italic, large like John Tottenham header (120px) */
@media screen and (min-width: 1025px) {
    .onboarding-welcome {
        top: 20px;
        left: 20px;
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-style: italic;
        font-size: 120px;
        line-height: 0.9;
        color: white;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    .onboarding-notebook,
    .onboarding-pocket {
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-style: italic;
        font-size: 60px;
        line-height: 1.1;
        color: white;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    .onboarding-notebook {
        top: 80px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        max-width: 800px;
    }

    .onboarding-pocket {
        top: 80px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        max-width: 900px;
    }
}

/* Mobile: Times italic, sized like mobile shop header (40px) */
@media screen and (max-width: 1024px) {
    .onboarding-welcome {
        top: 15px;
        left: 15px;
        right: 15px;
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-style: italic;
        font-size: 40px;
        line-height: 0.9;
        color: white;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    .onboarding-notebook,
    .onboarding-pocket {
        font-family: 'Times New Roman', Times, Georgia, serif;
        font-style: italic;
        font-size: 24px;
        line-height: 1.1;
        color: white;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        text-align: center;
        padding: 0 20px;
    }

    .onboarding-notebook {
        top: 70px;
        left: 0;
        right: 0;
    }

    .onboarding-pocket {
        top: 70px;
        left: 0;
        right: 0;
    }
}