:root {
    --canvas-font-scale: 0.8; /* Default for ~800px window height; updated dynamically by resizeCanvas() */
    --terminal-font-scale: 0.8; /* Default for ~800px viewport; updated dynamically for terminal scene */
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: #1a1a1a;
    font-family: Arial, sans-serif;
    color: #fff;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Editor Layout */

.editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebars */
.sidebar {
    background: #252525;
    border-right: 1px solid #333;
    overflow-y: auto;
}

/* Hide sidebars by default to prevent FOUC */
.left-sidebar,
.right-sidebar {
    display: none;
}

.left-sidebar {
    width: 300px;
    border-right: 1px solid #333;
}

.right-sidebar {
    width: 350px;
    border-left: 1px solid #333;
}

/* Show sidebars only in design mode */
body.design-mode .left-sidebar,
body.design-mode .right-sidebar {
    display: block;
}

/* Floating panel styles for Design mode */
.sidebar.floating-panel {
    position: fixed;
    top: 20px;
    z-index: 2000;
    max-height: calc(100vh - 40px);
    background: rgba(37, 37, 37, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.left-sidebar.floating-panel {
    left: 20px;
    border-right: none;
}

.right-sidebar.floating-panel {
    right: 20px;
    border-left: none;
}

/* Hover effects for floating panels */
.sidebar.floating-panel:hover {
    background: rgba(37, 37, 37, 0.98);
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Full-screen mode background */
.canvas-area.fullscreen {
    background: linear-gradient(135deg,
        #0a0a0a 0%,
        #1a1a1a 50%,
        #0a0a0a 100%);
    background-size: 300% 300%;
    animation: subtleShimmer 20s ease-in-out infinite;
}

@keyframes subtleShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Sign styling for main scene */
.sign-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.sign-line {
    font-family: 'Press Start 2P', monospace;
    color: #00FFFF;
    text-align: center;
    line-height: 1.3;
    text-shadow:
        0 0 10px #00FFFF,
        0 0 20px #00FFFF,
        0 0 30px #00FFFF;
    letter-spacing: 1px;
    animation: signGlitch 15s infinite;
}

.sign-line:first-child {
    font-size: calc(10.8pt * var(--canvas-font-scale));
    margin-bottom: 8px;
    color: #FFD700;
    text-shadow:
        0 0 10px #FF8C00,
        0 0 20px #FF8C00,
        0 0 30px #FF8C00;
    animation: signGlitchAmber 15s infinite;
}

/* Golden color for "REMY RACCOON'S" lines */
.sign-golden {
    font-size: calc(10.8pt * var(--canvas-font-scale));
    margin-bottom: 8px;
    color: #FFD700 !important;
    text-shadow:
        0 0 10px #FF8C00,
        0 0 20px #FF8C00,
        0 0 30px #FF8C00 !important;
    animation: signGlitchAmber 15s infinite !important;
}

.sign-line:last-child {
    font-size: calc(19.2pt * var(--canvas-font-scale));
}

@keyframes signGlitch {
    0%, 97% {
        transform: translate(0);
        filter: hue-rotate(0deg);
        text-shadow:
            0 0 10px #00FFFF,
            0 0 20px #00FFFF,
            0 0 30px #00FFFF;
    }
    97.5% {
        transform: translate(-2px, 1px);
        filter: hue-rotate(90deg);
        text-shadow:
            2px 0 #ff0000,
            -2px 0 #00ff00,
            0 0 10px #00FFFF,
            0 0 20px #00FFFF,
            0 0 30px #00FFFF;
    }
    98% {
        transform: translate(1px, -1px);
        filter: hue-rotate(180deg);
        text-shadow:
            -1px 0 #ff0000,
            1px 0 #00ff00,
            0 0 10px #00FFFF,
            0 0 20px #00FFFF,
            0 0 30px #00FFFF;
    }
    98.5% {
        transform: translate(-1px, 0);
        filter: hue-rotate(270deg);
        text-shadow:
            1px 0 #ff0000,
            -1px 0 #00ff00,
            0 0 10px #00FFFF,
            0 0 20px #00FFFF,
            0 0 30px #00FFFF;
    }
    99%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
        text-shadow:
            0 0 10px #00FFFF,
            0 0 20px #00FFFF,
            0 0 30px #00FFFF;
    }
}

@keyframes signGlitchAmber {
    0%, 97% {
        transform: translate(0);
        filter: hue-rotate(0deg);
        text-shadow:
            0 0 10px #FF8C00,
            0 0 20px #FF8C00,
            0 0 30px #FF8C00;
    }
    97.5% {
        transform: translate(-2px, 1px);
        filter: hue-rotate(90deg);
        text-shadow:
            2px 0 #ff0000,
            -2px 0 #00ff00,
            0 0 10px #FF8C00,
            0 0 20px #FF8C00,
            0 0 30px #FF8C00;
    }
    98% {
        transform: translate(1px, -1px);
        filter: hue-rotate(180deg);
        text-shadow:
            -1px 0 #ff0000,
            1px 0 #00ff00,
            0 0 10px #FF8C00,
            0 0 20px #FF8C00,
            0 0 30px #FF8C00;
    }
    98.5% {
        transform: translate(-1px, 0);
        filter: hue-rotate(270deg);
        text-shadow:
            1px 0 #ff0000,
            -1px 0 #00ff00,
            0 0 10px #FF8C00,
            0 0 20px #FF8C00,
            0 0 30px #FF8C00;
    }
    99%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
        text-shadow:
            0 0 10px #FF8C00,
            0 0 20px #FF8C00,
            0 0 30px #FF8C00;
    }
}

.canvas-wrapper {
    position: relative;
    border: 2px solid #444;
    background: transparent; /* Changed from #000 to allow hash canvas to show through */
    transition: border-color 0.3s ease;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Remove border in fullscreen modes */
.canvas-wrapper.borderless {
    border: none;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}


canvas {
    display: block;
    cursor: crosshair;
    position: relative;
    z-index: 10;
    opacity: 0;
}

/* Den canvas - main scene layer */
#denCanvas {
    position: absolute;
    z-index: 10; /* Above hash canvas (z-index: 1) */

    /* Remove mask gradient that creates haze */
    mask-image: none;
    -webkit-mask-image: none;

    /* Remove amber glow box-shadow */
    box-shadow: none;
}

/* Increase canvas z-index in edit mode to ensure it receives clicks */
canvas.edit-mode {
    z-index: 200;
}

#animationOverlays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

#monitorOverlays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.monitor-overlay {
    position: absolute;
    overflow: hidden;
    pointer-events: none; /* Default: clicks pass to canvas for clickTarget navigation */
    border-radius: 2px;
    background: transparent;
}

/* Retro CRT Effects for Entire Scene */
.canvas-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100; /* Above all content to cover entire scene */
    /* CRT Scanlines - Reduced opacity from 0.15 to 0.05 */
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.05) 0px,
        rgba(0, 0, 0, 0.05) 1px,
        transparent 1px,
        transparent 2px
    );
    animation: scanlineMove 8s linear infinite;
}

@keyframes scanlineMove {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}

/* Amber background frame - created dynamically via JavaScript, no CSS needed (inline styles) */

/* Screen Glow Effects */
#overlay-0::after,
#overlay-1::after,
#overlay-2::after,
#overlay-3::after,
#overlay-4::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    pointer-events: none;
    z-index: -1;
    border-radius: 4px;
    opacity: 0.6;
    animation: monitorGlow 3s ease-in-out infinite;
}

/* Different glow colors for different monitors */
#overlay-0::after {
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4), 0 0 40px rgba(0, 255, 0, 0.2);
}

#overlay-1::after,
#overlay-3::after,
#overlay-4::after {
    box-shadow: 0 0 20px rgba(204, 132, 0, 0.4), 0 0 40px rgba(204, 132, 0, 0.2);
}

#overlay-2::after {
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.1), 0 0 40px rgba(0, 200, 255, 0.05);
}

@keyframes monitorGlow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.7;
    }
}

/* Enable pointer events for interactive overlays (videos/iframes) */
.monitor-overlay.interactive {
    pointer-events: auto;
    overflow: visible; /* Allow YouTube controls to appear outside monitor bounds */
}

/* Enable pointer-events for monitor content when parent is interactive */
.monitor-overlay.interactive .monitor-content {
    pointer-events: auto;
}

/* Enable pointer-events for iframes inside interactive monitor content */
.monitor-overlay.interactive .monitor-content iframe {
    pointer-events: auto;
}

/* Enable pointer-events for direct iframe children of interactive overlays */
.monitor-overlay.interactive iframe {
    pointer-events: auto;
}

/* Custom Mute Button - Terminal Style */
.mute-button {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(204, 132, 0, 0.6);
    color: rgba(204, 132, 0, 0.9);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(204, 132, 0, 0.4);
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 2px;
    white-space: nowrap;
    opacity: 0.8;
}

.mute-button.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mute-button:hover {
    background: rgba(204, 132, 0, 0.2);
    border-color: rgba(204, 132, 0, 0.9);
    color: rgba(204, 132, 0, 1);
    text-shadow: 0 0 5px rgba(204, 132, 0, 0.6);
    box-shadow: 0 0 8px rgba(204, 132, 0, 0.3);
}

.mute-button:active {
    background: rgba(204, 132, 0, 0.3);
    transform: translateX(-50%) scale(0.98);
}

.mute-button.muted {
    color: rgba(204, 132, 0, 0.5);
    border-color: rgba(204, 132, 0, 0.3);
}

.mute-button.muted:hover {
    color: rgba(204, 132, 0, 0.8);
    border-color: rgba(204, 132, 0, 0.6);
}

.monitor-overlay.edit-mode {
    border: 2px dashed #4CAF50;
    pointer-events: none; /* Keep none even in edit mode - canvas handles clicks */
}

.monitor-overlay.selected {
    border: 3px solid #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

#remyCharacter {
    position: absolute;
    z-index: 20;
    transition: opacity 0.5s ease-in-out, filter 0.3s ease-out;
    pointer-events: none;
    border-radius: 2px;

    /* Base blending for natural integration */
    filter:
        brightness(0.92)
        contrast(1.05)
        saturate(0.85)
        drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));

    /* Performance optimization */
    transform: translateZ(0);
    will-change: transform, filter;
}

#remyCharacter img {
    width: 100%;
    height: 100%;
    object-fit: contain;

    /* Edge anti-aliasing for smoother blend */
    image-rendering: optimizeQuality;
    -webkit-font-smoothing: antialiased;
}

/* Atmospheric state classes */
#remyCharacter.campfire-active {
    filter:
        brightness(0.95)
        contrast(1.05)
        saturate(0.85)
        sepia(0.08)
        drop-shadow(0 8px 20px rgba(80, 40, 0, 0.4));
}

#remyCharacter.night-time {
    filter:
        brightness(0.85)
        contrast(1.1)
        saturate(0.8)
        hue-rotate(-5deg)
        drop-shadow(0 8px 16px rgba(0, 0, 20, 0.5));
}

#remyCharacter.dust-active {
    filter:
        brightness(0.90)
        contrast(0.95)
        saturate(0.8)
        blur(0.2px)
        drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

/* Ground shadow for depth */
.remy-shadow {
    position: absolute;
    background: radial-gradient(ellipse at center,
        rgba(0,0,0,0.4) 0%,
        rgba(0,0,0,0.2) 40%,
        transparent 70%);
    transform: scaleY(0.5);
    z-index: 4;
    transition: all 0.3s ease-out;
    pointer-events: none;
}

/* Subtle animation for life-like presence */
@keyframes subtle-breathing {
    0%, 100% { transform: translateZ(0) scaleY(1); }
    50% { transform: translateZ(0) scaleY(0.98); }
}

#remyCharacter.breathing {
    animation: subtle-breathing 4s ease-in-out infinite;
}

/* Monitor Content Styles */
.monitor-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    /* Pointer events are managed by parent .monitor-overlay, not here */
}

.monitor-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.monitor-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.animated-text {
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    font-weight: bold;
    text-align: center;
    animation-fill-mode: forwards;
}

/* Briefing Preview Typing Animation */
.briefing-preview {
    font-family: monospace;
}

.briefing-line {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.briefing-line.visible {
    opacity: 1;
}

.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 10px;
    background-color: rgba(204, 132, 0, 0.6);
    margin-left: 2px;
    animation: cursorBlink 0.8s infinite;
    vertical-align: text-bottom;
}

@keyframes cursorBlink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* News Monitor Styles (Main Scene - Monitor 1) */
#news-monitor-body {
    transition: opacity 0.3s ease-in-out;
    position: relative;
    overflow: hidden; /* Hide content that scrolls out of view */
}

.news-scroll-wrapper {
    position: relative;
    will-change: transform; /* Optimize for smooth animation */
}

/* Login Button Styles (Main Scene Only) */
.login-button {
    transition: all 0.15s ease;
    animation: loginPulse 3.5s ease-in-out infinite;
}

.login-hint {
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.4s ease;
}

.login-hint.visible {
    opacity: 1;
    transform: translateY(0);
    text-shadow:
        0 0 5px rgba(204, 132, 0, 0.4),
        0 0 10px rgba(204, 132, 0, 0.2);
}

.login-text-container:hover .login-hint {
    opacity: 1;
    transform: translateY(0);
    text-shadow:
        0 0 5px rgba(204, 132, 0, 0.4),
        0 0 10px rgba(204, 132, 0, 0.2);
}

.login-button.active-pulse {
    animation: loginPulseFast 2.5s ease-in-out infinite;
}

@keyframes loginPulse {
    0%, 100% {
        opacity: 0.8;
        text-shadow:
            0 0 5px rgba(255, 215, 0, 0.6),
            0 0 10px rgba(255, 215, 0, 0.4),
            0 0 15px rgba(255, 215, 0, 0.2);
    }
    50% {
        opacity: 1;
        text-shadow:
            0 0 8px rgba(255, 215, 0, 0.8),
            0 0 15px rgba(255, 215, 0, 0.6),
            0 0 20px rgba(255, 215, 0, 0.4);
    }
}

@keyframes loginPulseFast {
    0%, 100% {
        opacity: 0.8;
        text-shadow:
            0 0 8px rgba(255, 215, 0, 0.7),
            0 0 12px rgba(255, 215, 0, 0.5),
            0 0 18px rgba(255, 215, 0, 0.3);
    }
    50% {
        opacity: 1;
        text-shadow:
            0 0 10px rgba(255, 215, 0, 0.9),
            0 0 18px rgba(255, 215, 0, 0.7),
            0 0 25px rgba(255, 215, 0, 0.5);
    }
}

/* LED Matrix Display */
.led-matrix {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #331100;
    border-radius: 4px;
    padding: 3px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

.led-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.5px 0;
}

.led {
    width: 6px;
    height: 6px;
    border-radius: 0;
    margin: 0.5px;
    background: #331100;
    transition: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.led.on {
    background: #FF4500;
    box-shadow: none;
    animation: pixelFlicker 4s infinite ease-in-out;
}

@keyframes pixelFlicker {
    0%, 85%, 100% {
        opacity: 1;
        background: #FF4500;
    }
    87%, 89% {
        opacity: 0.7;
        background: #CC3300;
    }
    91%, 93% {
        opacity: 0.9;
        background: #FF4400;
    }
}

.matrix-rain {
    position: relative;
    overflow: hidden;
    background: #000;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    color: #FFD700;
    font-size: 10px;
    line-height: 1;
    width: 100%;
    height: 100%;
    display: block;
}

.matrix-char {
    position: absolute;
    color: #FFD700;
    opacity: 0.8;
    font-weight: bold;
    animation: matrixRain linear infinite;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.monitor-text {
    color: #FFD700;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.95);
    white-space: pre-wrap;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    text-shadow: 0 0 3px rgba(255, 215, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.monitor-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(255, 215, 0, 0.03) 50%, transparent 100%);
    pointer-events: none;
}

/* Green monochrome styling for monitor 0 (welcome screen) */
.monitor-text.green {
    color: #00ff00;
    border: 1px solid rgba(0, 255, 0, 0.2);
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.4);
}

.monitor-text.green::before {
    background: linear-gradient(45deg, transparent 0%, rgba(0, 255, 0, 0.03) 50%, transparent 100%);
}

/* Matrix rain with green characters for monitor 0 */
.matrix-rain.green {
    color: #00ff00;
}

.matrix-rain.green .matrix-char {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

/* Horizontal scrolling text overlay */
.scrolling-text {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    height: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid #00ff00;
    display: flex;
    align-items: center;
}

.scrolling-content {
    display: inline-block;
    color: #00ff00;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    animation: scroll-horizontal 22.5s linear infinite;
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.4);
}

/* Static ANSI text for REMY */
.ansi-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff00;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 8px;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.4);
    white-space: pre;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

@keyframes scroll-horizontal {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Panel Styles */
.panel {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    margin: 15px;
    overflow: hidden;
}

.panel-title {
    background: #333;
    color: #00ffff;
    margin: 0;
    padding: 12px 15px;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #444;
}

.control-section {
    padding: 15px;
}

.control-row {
    display: flex;
    align-items: center;
    margin: 12px 0;
    gap: 12px;
}

.control-label {
    min-width: 80px;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
}

.control-slider {
    flex: 1;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.control-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.control-value {
    min-width: 45px;
    color: #00ffff;
    font-weight: bold;
    text-align: right;
    font-size: 12px;
}

.control-btn, .toggle-btn, .quick-btn {
    background: #444;
    border: 1px solid #666;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.control-btn:hover, .toggle-btn:hover, .quick-btn:hover {
    background: #555;
    border-color: #00ffff;
    color: #00ffff;
}

.toggle-btn.active {
    background: #00ffff;
    color: #1a1a1a;
}

/* Action buttons (Save/Export) */
.action-btn {
    background: #00ffff;
    color: #1a1a1a;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 13px;
    min-width: 70px;
}

.action-btn:hover {
    background: #00cccc;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 255, 255, 0.3);
}

.selector-btn {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    flex: 1;
    margin: 2px;
}

.selector-btn:hover {
    background: #444;
    border-color: #00ffff;
    color: #fff;
}

.selector-btn.active {
    background: #00ffff;
    color: #1a1a1a;
    border-color: #00ffff;
    font-weight: bold;
}

.selector-btn.animation-enabled {
    border: 2px solid #00ff00;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

/* Custom Checkbox Styling */
.effect-enable-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 3px;
    background: #1a1a1a;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.effect-enable-checkbox:hover {
    border-color: #00ffff;
}

.effect-enable-checkbox:checked {
    background: #00ffff;
    border-color: #00ffff;
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.4);
}

.effect-enable-checkbox:checked::after {
    content: '✓';
    color: #1a1a1a;
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    left: 2px;
    top: -2px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.checkbox-label {
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
}

.quick-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.monitor-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

/* Sprite Gallery */
.sprite-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
}

.sprite-item {
    background: #333;
    border: 2px solid #444;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sprite-item:hover {
    border-color: #00ffff;
    transform: translateY(-2px);
}

.sprite-item.active {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.sprite-item.disabled {
    opacity: 0.4;
    border-color: #666;
    background: rgba(50, 50, 50, 0.5);
    position: relative;
}

.sprite-item.disabled:hover {
    border-color: #888;
    transform: none;
}

.sprite-toggle {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #666;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #00ff00;
    transition: all 0.2s ease;
    z-index: 10;
}

.sprite-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: #00ffff;
}

.sprite-item.disabled .sprite-toggle {
    color: #ff4444;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.sprite-preview {
    width: 60px;
    height: 75px;
    object-fit: contain;
    margin-bottom: 5px;
    background: #222;
    border-radius: 3px;
}

.sprite-name {
    color: #ccc;
    font-size: 11px;
    font-weight: 500;
}

.animation-controls {
    padding: 15px;
    border-top: 1px solid #444;
}

/* Property Panel */
.property-row {
    display: flex;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
}

.property-label {
    min-width: 60px;
    color: #ccc;
    font-size: 12px;
}

.property-input {
    background: #444;
    border: 1px solid #666;
    border-radius: 3px;
    padding: 6px 8px;
    color: #fff;
    width: 80px;
    font-size: 12px;
}

.monitor-info {
    color: #4CAF50;
    font-size: 11px;
    margin-top: 10px;
}

/* Animation System */
.firefly {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffff88 0%, #ffff44 50%, transparent 100%);
    pointer-events: none;
    z-index: 5;
    opacity: 0.5;
}

.firefly.active {
    animation: fireflyGlow var(--animation-duration, 3s) ease-in-out infinite;
}

@keyframes fireflyGlow {
    0% {
        opacity: calc(0.3 * var(--firefly-brightness, 0.8));
        transform: translate(0, 0) scale(0.8);
    }
    25% {
        opacity: calc(0.8 * var(--firefly-brightness, 0.8));
        transform: translate(var(--drift-distance, -1px), calc(var(--drift-distance, 1px) * 1)) scale(1.0);
    }
    50% {
        opacity: var(--firefly-brightness, 0.8);
        transform: translate(calc(var(--drift-distance, 1px) * 1), calc(var(--drift-distance, -1px) * 1)) scale(1.2);
    }
    75% {
        opacity: calc(0.6 * var(--firefly-brightness, 0.8));
        transform: translate(calc(var(--drift-distance, -1px) * 1), calc(var(--drift-distance, -1px) * 1)) scale(1.0);
    }
    100% {
        opacity: calc(0.3 * var(--firefly-brightness, 0.8));
        transform: translate(0, 0) scale(0.8);
    }
}

.firefly-debug-area {
    position: absolute;
    border: 2px dashed #ffff88;
    background: rgba(255, 255, 136, 0.1);
    pointer-events: none;
    z-index: 14;
    display: none;
}

.firefly-debug-area.visible {
    display: block;
}

.campfire-glow {
    position: absolute;
    width: 200px;
    height: 150px;
    background: radial-gradient(ellipse at center,
        rgba(255, 140, 0, var(--glow-opacity, 0.3)) 0%,
        rgba(255, 100, 0, calc(var(--glow-opacity, 0.3) * 0.7)) 40%,
        transparent 70%);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
}

.campfire-glow.fade-in {
    animation: campfireFadeIn 2.5s ease-out forwards;
}

.campfire-glow.active {
    animation: campfireFlicker 4s ease-in-out infinite;
}

@keyframes campfireFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: var(--glow-opacity, 0.5);
        transform: scale(1.0);
    }
}

@keyframes campfireFlicker {
    0% { opacity: var(--flicker-min, 0.2); transform: scale(0.9); }
    15% { opacity: var(--flicker-max, 0.4); transform: scale(1.1); }
    30% { opacity: var(--flicker-mid, 0.3); transform: scale(0.95); }
    50% { opacity: var(--flicker-peak, 0.5); transform: scale(1.05); }
    65% { opacity: var(--flicker-mid, 0.35); transform: scale(0.9); }
    80% { opacity: var(--flicker-max, 0.45); transform: scale(1.0); }
    100% { opacity: var(--flicker-min, 0.2); transform: scale(0.9); }
}

.bitcoin-pulse {
    position: absolute;
    width: 60px;
    height: 80px;
    background: radial-gradient(ellipse at center, rgba(255, 165, 0, 0.4) 0%, transparent 70%);
    pointer-events: none;
    z-index: 5;
}

.bitcoin-pulse.active {
    animation: bitcoinPulse var(--pulse-speed, 3s) ease-in-out infinite;
}

.bitcoin-pulse.fade-in {
    animation: bitcoinFadeIn 2.5s ease-in forwards;
}

@keyframes bitcoinPulse {
    0% { opacity: 0.1; transform: scale(0.95); }
    50% { opacity: 0.3; transform: scale(1.05); }
    100% { opacity: 0.1; transform: scale(0.95); }
}

@keyframes bitcoinFadeIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 0.3; transform: scale(1.0); }
}

/* Smoke Animation - Dark Atmospheric Fog */
.smoke-particle {
    position: absolute;
    pointer-events: none;
    z-index: 4;
    background: radial-gradient(ellipse at center,
        rgba(60, 50, 70, var(--smoke-opacity, 0.3)) 0%,
        rgba(40, 35, 50, calc(var(--smoke-opacity, 0.3) * 0.7)) 20%,
        rgba(30, 25, 40, calc(var(--smoke-opacity, 0.3) * 0.4)) 40%,
        transparent 65%);
    border-radius: 60% 40% 50% 50%;
    filter: blur(4px);
    mix-blend-mode: screen;
    opacity: 0.6;
}

.smoke-particle.active {
    animation: smokeRise var(--smoke-speed, 12s) ease-out infinite;
}

.smoke-particle.fade-in {
    animation: smokeFadeIn 0.5s ease-in forwards;
}

@keyframes smokeRise {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.3) rotate(0deg);
    }
    15% {
        opacity: calc(var(--smoke-opacity, 0.3) * 0.6);
        transform: translate(calc(var(--drift-distance, 20px) * -0.3), -30px) scale(0.8) rotate(10deg);
    }
    40% {
        opacity: var(--smoke-opacity, 0.3);
        transform: translate(calc(var(--drift-distance, 20px) * 0.2), -80px) scale(1.4) rotate(-5deg);
    }
    70% {
        opacity: calc(var(--smoke-opacity, 0.3) * 0.5);
        transform: translate(calc(var(--drift-distance, 20px) * 0.8), -140px) scale(1.8) rotate(8deg);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--drift-distance, 20px) * 1.5), -200px) scale(2.2) rotate(-3deg);
    }
}

@keyframes smokeFadeIn {
    0% { opacity: 0; }
    100% { opacity: var(--smoke-opacity, 0.3); }
}

/* Keyframes */
@keyframes subtleGlow {
    0% {
        text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff;
        opacity: 0.8;
    }
    50% {
        text-shadow: 0 0 20px #00ffff, 0 0 35px #00ffff, 0 0 50px #00ffff, 0 0 65px #00ffff;
        opacity: 1;
    }
    100% {
        text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff;
        opacity: 0.8;
    }
}

@keyframes matrixRain {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(calc(100vh + 100%)); opacity: 0; }
}

/* Canvas-based hash background (300 concurrent hashes with scaled fonts) */
#hash-background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Below den canvas (z-index: 10) */
    pointer-events: none;
    opacity: 1; /* Ensure it's visible (overrides generic canvas opacity: 0) */

    /* No mask - hashes render across entire canvas */
    mask-image: none;
    -webkit-mask-image: none;
}

/* Chat View Styles */
.editor-body.chat-view-active .sidebar {
    display: none;
}

.editor-body.chat-view-active .canvas-area {
    width: 100%;
    margin: 0;
}

.chat-back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    color: #00ffff;
    border: 2px solid #00ffff;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.2);
}

.chat-back-button:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 6px 30px rgba(0, 255, 255, 0.4);
    transform: translateY(-2px);
}

.chat-back-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 255, 255, 0.3);
}

/* Chat System Styles */
.monitor-content.chat-mode {
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    padding: 0 !important;
    position: relative;
    pointer-events: auto !important;
    z-index: 50;
}

.chat-history {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    color: #00ff00;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: calc(10pt * var(--canvas-font-scale));
    padding: 12px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #FFD700 rgba(0, 0, 0, 0.3);
    pointer-events: auto !important;
    touch-action: pan-y;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 3px;
    opacity: 0.8;
}

.chat-history::-webkit-scrollbar-thumb:hover {
    background: #FFA500;
}

.chat-messages-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    justify-content: flex-end;
}

.chat-message {
    width: 100%;
    margin-bottom: 8px;
    line-height: 1.3;
    word-wrap: break-word;
    word-break: break-word;
}

.chat-sender {
    font-weight: bold;
    margin-right: 6px;
    display: inline-block;
    min-width: 50px;
}

.chat-text {
    color: #ffffff;
    display: inline-block;
    width: calc(100% - 56px);
    vertical-align: top;
}

/* Formatted text styles */
.chat-text .formatted-content {
    line-height: 1.4;
}

.chat-text .section-header {
    color: #FFD700;
    font-weight: bold;
    margin: 8px 0 4px 0;
    display: block;
}

.chat-text .bullet-list {
    margin: 4px 0;
    padding-left: 10px;
}

.chat-text .bullet-item {
    display: block;
    margin-bottom: 2px;
    text-indent: -6px;
    padding-left: 6px;
}

.chat-text .source-link {
    color: #00ffff;
    text-decoration: none;
    font-size: calc(10pt * var(--canvas-font-scale));
}

.chat-text .source-link:hover {
    color: #FFD700;
    text-decoration: underline;
}

.chat-text .bold {
    font-weight: bold;
    color: #FFD700;
}

.chat-text .section-break {
    border-top: 1px solid #333;
    margin: 6px 0;
    opacity: 0.5;
}

#chat-interface {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: 90%;
    max-width: 600px;
}

.chat-input-container {
    display: flex;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 12px;
    gap: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

#chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #B8860B;
    border-radius: 4px;
    padding: 12px 16px;
    color: #FFD700;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#chat-input::placeholder {
    color: #B8860B;
    opacity: 0.8;
}

#chat-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
    background: rgba(0, 0, 0, 0.95);
}

#chat-send {
    background: #FFD700;
    color: #000000;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

#chat-send:hover {
    background: #FFA500;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

#chat-send:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
}

/* Chat Loading and Error States */
.chat-typing {
    color: #00ffff !important;
    font-style: italic;
}

.chat-error {
    color: #ff4444 !important;
}

.typing-dots {
    animation: typing-pulse 1.5s infinite;
}

@keyframes typing-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Disabled input states */
#chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.6);
}

#chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #B8860B;
    transform: none;
}

#chat-send:disabled:hover {
    background: #B8860B;
    transform: none;
    box-shadow: none;
}

/* Transcript Display Styles */
.monitor-transcript {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.95);
    color: #FFD700;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

.video-header {
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.98);
    padding: 10px;
    border-bottom: 2px solid #FFD700;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.video-title {
    color: #FFD700;
    font-size: 10px;
    font-weight: normal;
    margin: 0 0 3px 0;
    line-height: 1.2;
    text-shadow: 0 0 3px rgba(255, 215, 0, 0.4);
}

.video-subtitle {
    color: #FFD700;
    font-size: 10px;
    font-weight: normal;
    margin: 0 0 5px 0;
    line-height: 1.2;
    text-shadow: 0 0 3px rgba(255, 215, 0, 0.4);
    opacity: 0.8;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #66ff66;
}

.channel {
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 2px rgba(255, 255, 0, 0.5);
}

.published {
    color: #FFD700;
    text-shadow: 0 0 2px rgba(255, 215, 0, 0.5);
}

.transcript-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.transcript-container::-webkit-scrollbar {
    display: none;
}



.transcript-content {
    line-height: 1.4;
}

.transcript-segment {
    margin-bottom: 8px;
    padding: 4px 6px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 11px;
}

.transcript-segment:hover {
    background: rgba(255, 215, 0, 0.05);
    cursor: pointer;
}

.transcript-segment.active {
    background: rgba(255, 215, 0, 0.15);
    border-left: 3px solid #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
    transform: translateX(2px);
}

.timestamp {
    color: #ffff00;
    font-weight: bold;
    margin-right: 8px;
    text-shadow: 0 0 2px rgba(255, 255, 0, 0.5);
    display: inline-block;
    min-width: 50px;
}

.text {
    color: #FFD700;
    line-height: 1.3;
}

/* YouTube Player Container */
#youtube-player-container {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#youtube-player {
    width: 100%;
    height: 100%;
}

/* Error state styles */
.error-header {
    color: #ff4444;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 0 0 3px rgba(255, 68, 68, 0.5);
}

.error-message {
    color: #ff8888;
    font-size: 10px;
    margin-bottom: 5px;
}

.fallback-info {
    color: #ffaa00;
    font-size: 10px;
    font-style: italic;
}

/* Chat Window Styles for Monitor 3 */
.chat-window {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.95);
    color: #FFD700;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: calc(10pt * var(--canvas-font-scale));
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid #FFD700;
    background: rgba(0, 0, 0, 0.98);
}

.chat-title {
    color: #FFD700;
    font-weight: bold;
    font-size: calc(10pt * var(--canvas-font-scale));
}

.chat-status {
    color: #00ff00;
    font-size: calc(10pt * var(--canvas-font-scale));
}

.chat-messages {
    flex: 1;
    padding: 6px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-messages::-webkit-scrollbar {
    display: none;
}

.chat-message {
    margin-bottom: 4px;
    line-height: 1.3;
}

.chat-time {
    color: #B8860B;
    margin-right: 4px;
    font-size: calc(10pt * var(--canvas-font-scale));
}

.chat-user {
    color: #FFD700;
    font-weight: bold;
    margin-right: 4px;
    font-size: calc(10pt * var(--canvas-font-scale));
}

.chat-text {
    color: #FFD700;
    font-size: calc(10pt * var(--canvas-font-scale));
}

.chat-input-line {
    margin-top: 4px;
    color: #FFD700;
    font-size: calc(10pt * var(--canvas-font-scale));
}

.chat-prompt {
    color: #FFD700;
}

.chat-cursor {
    color: #FFD700;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Recent Videos Styles for Monitor 1 */
.recent-videos {
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    color: #FFD700;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    padding: 6px;
    overflow-y: auto;
}

/* Terminal-themed scrollbar styling for recent videos */
.recent-videos::-webkit-scrollbar {
    width: 8px;
}

.recent-videos::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(204, 132, 0, 0.2);
}

.recent-videos::-webkit-scrollbar-thumb {
    background: rgba(204, 132, 0, 0.8);
    border-radius: 4px;
}

.recent-videos::-webkit-scrollbar-thumb:hover {
    background: rgba(204, 132, 0, 1);
}

.recent-videos-container {
    height: calc(100% - 25px);
    overflow: hidden;
    position: relative;
}

.recent-videos-list.scrolling-list {
    display: flex;
    flex-direction: column;
}

.recent-videos-header {
    color: #FFD700;
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 6px;
    border-bottom: 1px solid #FFD700;
    padding-bottom: 2px;
}

.recent-videos-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.video-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 6px;
    font-size: 10px;
    cursor: pointer;
    padding: 3px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.video-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(2px);
}

.video-item.selected {
    background: rgba(255, 215, 0, 0.2);
    border-left: 2px solid #FFD700;
    padding-left: 4px;
}

.video-info {
    flex: 1;
    line-height: 1.3;
}

.video-title-clickable {
    color: #FFD700;
    font-size: 11px;
    margin-bottom: 2px;
    font-weight: normal;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
    max-height: 26px;
    overflow: hidden;
}

.video-meta-small {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
}

.video-channel {
    color: #FFA500;
    font-weight: bold;
}

.video-time {
    color: #B8860B;
}

/* ============================================================================ */
/* RESEARCH SCENE STYLES (Design 1: Research Assistant Mode) */
/* ============================================================================ */

.research-chat {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    color: #00ff00;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.research-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.research-message {
    display: flex;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease-in;
}

.research-message.user {
    justify-content: flex-end;
}

.research-message.assistant {
    justify-content: flex-start;
}

.research-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: calc(10pt * var(--canvas-font-scale));
    line-height: 1.4;
    position: relative;
}

.research-message.user .research-bubble {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    color: #00ff00;
}

.research-message.assistant .research-bubble {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid #FFA500;
    color: #FFA500;
}

.citation-badge {
    display: inline-block;
    background: #FFD700;
    color: #000;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: calc(8pt * var(--canvas-font-scale));
    font-weight: bold;
    margin: 0 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.citation-badge:hover {
    background: #FFA500;
    transform: scale(1.1);
}

.research-sources {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    color: #FFA500;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sources-header {
    padding: 12px;
    border-bottom: 2px solid #FFA500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sources-header h3 {
    margin: 0;
    font-size: calc(12pt * var(--canvas-font-scale));
    color: #FFA500;
}

#sources-count {
    font-size: calc(9pt * var(--canvas-font-scale));
    color: #FFD700;
}

.sources-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.no-sources {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-top: 50px;
}

.source-item {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid #FFA500;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.source-item:hover {
    background: rgba(255, 165, 0, 0.2);
    border-color: #FFD700;
}

.source-title {
    font-weight: bold;
    font-size: calc(10pt * var(--canvas-font-scale));
    margin-bottom: 4px;
    color: #FFD700;
}

.source-channel {
    font-size: calc(9pt * var(--canvas-font-scale));
    color: #FFA500;
    margin-bottom: 6px;
}

.source-timestamp {
    font-size: calc(8pt * var(--canvas-font-scale));
    color: #666;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.research-suggestions {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    color: #00ff00;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.suggestions-header {
    padding: 12px;
    border-bottom: 2px solid #00ff00;
    font-size: calc(10pt * var(--canvas-font-scale));
    font-weight: bold;
    color: #00ff00;
}

.suggestions-content {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-chip {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: calc(9pt * var(--canvas-font-scale));
    transition: all 0.2s ease;
}

.suggestion-chip:hover {
    background: rgba(0, 255, 0, 0.2);
    border-color: #FFD700;
    color: #FFD700;
}

.research-status {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    color: #FFD700;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #333;
}

.status-label {
    font-size: calc(9pt * var(--canvas-font-scale));
    color: #FFA500;
}

.status-item span:last-child {
    font-size: calc(9pt * var(--canvas-font-scale));
    color: #FFD700;
    font-weight: bold;
}

/* ============================================================================ */
/* CLI SCENE STYLES (Design 2: Terminal Command Mode) */
/* ============================================================================ */

.cli-terminal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 14; /* Just behind monitor overlays (15) and Remy (20) */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Block pointer events by default - children will enable as needed */
}

.cli-terminal-overlay .terminal-container {
    pointer-events: auto;
    width: 90%;
    height: 97%;
}



.terminal-container {
    width: 90%;
    height: 96%;
    max-width: 1200px;
    background: rgba(0, 0, 0, 1);
    border: 2px solid #FFA500;
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    color: #FFA500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7),
                0 24px 96px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: transparent;
    border-bottom: 1px solid #FFA500;
    padding: 8px 16px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 10pt;
    position: relative;
}

.terminal-title {
    color: #FFA500;
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10pt;
}

.terminal-close-btn {
    background: transparent;
    border: none;
    color: #FFA500;
    font-size: 12pt;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    padding: 0 8px;
    transition: color 0.2s ease;
    line-height: 1;
    position: absolute;
    right: 16px;
}

.terminal-close-btn:hover {
    color: #FFA500;
}

.terminal-close-btn:active {
    color: #FFD700;
}

.terminal-status {
    color: #00ff00;
    font-size: 9pt;
}

/* Terminal Subpanels */
.terminal-subpanels {
    display: flex;
    border-top: 2px solid #FFA500;
    border-bottom: 2px solid #FFA500;
    background: rgba(0, 0, 0, 0.7);
    height: calc(33.33% - 4px); /* 1/3 of total space between header and prompt */
    flex-shrink: 0;
}

.subpanel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 1);
    pointer-events: none; /* Block pointer events by default */
}

/* Enable pointer events for interactive subpanels (e.g., video player) */
.subpanel.interactive {
    pointer-events: auto;
    padding: 0; /* Remove padding to allow iframe to fill entire area */
}

.subpanel.interactive .subpanel-content {
    pointer-events: auto;
}

.subpanel-divider {
    width: 2px;
    background: #FFA500;
    flex-shrink: 0;
}

.subpanel-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.subpanel-1 .subpanel-content {
    text-align: center;
}

.welcome-text {
    color: #FFA500;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: calc(10pt * var(--canvas-font-scale));
    font-weight: bold;
    margin-bottom: 4px;
    text-shadow: 0 0 3px rgba(255, 165, 0, 0.3);
}

.help-text {
    color: rgba(255, 165, 0, 0.8);
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: calc(9pt * var(--canvas-font-scale));
    text-shadow: 0 0 2px rgba(255, 165, 0, 0.2);
}

.remy-sprite-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remy-sprite {
    width: 60px;
    height: 75px;
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 165, 0, 0.6);
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: calc(8pt * var(--canvas-font-scale));
}

.terminal-output {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    line-height: 1.5;
    font-size: 11pt;
    letter-spacing: 0.02em;
}

/* Terminal-themed scrollbar styling */
.terminal-output::-webkit-scrollbar,
.monitor-1-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track,
.monitor-1-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(204, 132, 0, 0.2);
}

.monitor-1-content::-webkit-scrollbar-track {
    margin-top: 5px;
}

.terminal-output::-webkit-scrollbar-thumb,
.monitor-1-content::-webkit-scrollbar-thumb {
    background: rgba(204, 132, 0, 0.8);
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover,
.monitor-1-content::-webkit-scrollbar-thumb:hover {
    background: rgba(204, 132, 0, 1);
}

.terminal-line {
    margin-bottom: 4px;
    word-wrap: break-word;
    white-space: pre-wrap;
    text-align: left;
}

.terminal-prompt {
    color: #FFA500;
    font-weight: bold;
    margin-right: 8px;
    font-size: 10pt; /* Match terminal title size */
}

.terminal-text {
    color: #E0E0E0;
}

.terminal-input-line {
    border-top: 1px solid #FFA500;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    background: transparent;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #E0E0E0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 11pt;
    margin-left: 8px;
}

.terminal-input::placeholder {
    color: #666;
}

.terminal-command {
    color: #E0E0E0;
}

/* User input line background */
.terminal-line:has(.terminal-command) {
    background: rgba(255, 0, 0, 0.05);
    padding: 4px 8px;
    margin-left: -8px;
    margin-right: -8px;
    border-radius: 2px;
}

.terminal-error {
    color: #ff4444;
}

.terminal-success {
    color: #00AAFF;
}

.terminal-info {
    color: #E0E0E0;
}

.terminal-gold {
    color: #FFA500;
}

.terminal-loading {
    color: #FFA500;
    animation: blink 1s infinite;
}

/* Terminal secondary text styles */
.terminal-timestamp {
    color: #999999;
    font-size: 9pt;
}

.terminal-meta {
    color: #B0B0B0;
    font-size: 9pt;
}

.terminal-warning {
    color: #FFA500;
}

/* ============================================================================
   Transaction Monitoring Styles
   ============================================================================ */

/* Live progress bar animation */
.tx-progress-line {
    color: #00AAFF;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    animation: pulse-glow 2s ease-in-out infinite;
    letter-spacing: 0.5px;
}

/* Transaction stage indicators */
.tx-stage-indicator {
    color: #E0E0E0;
    font-family: 'JetBrains Mono', monospace;
}

.tx-stage-active {
    color: #00FF00;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.tx-stage-complete {
    color: #00AAFF;
}

.tx-stage-pending {
    color: #666;
}

/* ASCII art success animation */
.terminal-success-art {
    color: #00FF00;
    font-family: 'JetBrains Mono', monospace;
    text-align: center;
    animation: success-flash 0.5s ease-in;
}

/* Pulse glow effect for progress bar */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 5px rgba(0, 170, 255, 0.5);
    }
    50% {
        opacity: 0.8;
        text-shadow: 0 0 10px rgba(0, 170, 255, 0.8);
    }
}

/* Success flash animation */
@keyframes success-flash {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Terminal markdown formatting styles */
.terminal-bold {
    color: #FFD700;
    font-weight: bold;
}

.terminal-italic {
    color: #00aaff;
    font-style: italic;
}

.terminal-code {
    color: #00aaff;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 4px;
    border-radius: 2px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 10pt;
}

.terminal-heading {
    color: #FFD700;
    font-weight: bold;
    font-size: 14pt;
    margin: 8px 0 4px 0;
    display: block;
}

.terminal-list {
    margin: 4px 0;
    padding-left: 16px;
}

.terminal-list-item {
    color: #E0E0E0;
    margin: 6px 0 !important;
    line-height: 1.4 !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

.terminal-link {
    color: #00aaff;
    text-decoration: underline;
    cursor: pointer;
}

.terminal-link:hover {
    color: #66ccff;
}

.terminal-paragraph {
    margin: 8px 0;
    color: inherit;
}

/* Ensure terminal-text elements and their children inherit the correct color */
.terminal-text .terminal-paragraph {
    color: #E0E0E0;
}

.terminal-text .terminal-link {
    color: #00aaff;
    text-decoration: underline;
}

/* Enhanced Markdown Styles for Terminal */
.terminal-table {
    margin: 12px 0;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 11pt;
    width: 100%;
}

.terminal-table th,
.terminal-table td {
    border: 1px solid #FFA500;
    padding: 6px 10px;
    text-align: left;
}

.terminal-table th {
    background: rgba(255, 165, 0, 0.2);
    color: #FFD700;
    font-weight: 600;
}

.terminal-table td {
    color: #E0E0E0;
}

.terminal-blockquote {
    border-left: 3px solid #FFA500;
    margin: 12px 0;
    padding: 8px 12px;
    background: rgba(255, 165, 0, 0.05);
    color: #FFD700;
    font-style: italic;
}

.terminal-hr {
    border: none;
    border-top: 1px solid #FFA500;
    margin: 16px 0;
    opacity: 0.5;
}

/* Tree-style lists for terminal */
.terminal-list-item::before {
    content: '';
    color: #FFA500;
    margin-right: 4px;
}

.terminal-list-item:last-child::before {
    content: '';
}

/* Tool execution indicators */
.terminal-tool-indicator {
    display: inline-block;
    background: rgba(0, 170, 255, 0.1);
    border: 1px solid #00aaff;
    color: #00aaff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10pt;
    margin: 4px 0;
}

/* Metadata footer */
.terminal-metadata {
    font-size: 9pt;
    color: #999;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #333;
}

/* Streaming cursor animation */
.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #0f0;
    margin-left: 2px;
    animation: blink 1s infinite;
}

/* Message received indicator line */
.message-received-line {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #FFA500;
    font-weight: 500;
    text-align: left !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100%;
}

.message-received-line .terminal-text {
    display: inline !important;
    vertical-align: middle;
}

.message-received-line .terminal-cursor-raccoon {
    display: inline-block !important;
    vertical-align: middle;
}

/* Raccoon emoji cursor for message received indicator and streaming */
.terminal-cursor-raccoon {
    display: inline-block;
    margin-left: 2px;
    animation: blink 1s infinite;
}

.terminal-cursor-raccoon::after {
    content: '🦝';
    font-size: 1.2em;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Fade out animation for cursor */
@keyframes cursorFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.terminal-streaming {
    color: #E0E0E0;
    display: inline;
    text-align: left;
}

/* Video Control Buttons */
.video-control-btn {
    background: transparent;
    border: 1px solid rgba(204, 132, 0, 0.6);
    color: rgba(204, 132, 0, 0.9);
    font-family: monospace;
    font-size: 14px;
    font-weight: bold;
    padding: 6px 12px;
    margin: 0 4px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
}

.video-control-btn:hover {
    background: rgba(204, 132, 0, 0.2);
    border-color: rgba(204, 132, 0, 1);
    color: rgba(204, 132, 0, 1);
    transform: translateY(-1px);
}

.video-control-btn:active {
    background: rgba(204, 132, 0, 0.4);
    transform: translateY(0);
}

.video-control-btn:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(204, 132, 0, 0.5);
}

/* Video controls container */
.video-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.terminal-code-block {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(204, 132, 0, 0.3);
    border-radius: 4px;
    padding: 8px;
    margin: 8px 0;
    color: #00aaff;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 10pt;
    white-space: pre-wrap;
    overflow-x: auto;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.ascii-art {
    color: #FFD700;
    font-size: calc(8pt * var(--canvas-font-scale));
    line-height: 1;
    white-space: pre;
    margin: 8px 0;
}

/* Research input interface */
#research-interface {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: 70%;
    max-width: 800px;
}

.research-input-container {
    display: flex;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 12px;
    gap: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.2);
}

#research-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00aa00;
    border-radius: 4px;
    padding: 12px 16px;
    color: #00ff00;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#research-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

#research-send {
    background: #00aa00;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    color: #000;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#research-send:hover {
    background: #00ff00;
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Terminal scene-specific overrides */

/* Remove CRT glow effect from monitor content in terminal scene */
.terminal-scene .video-title {
    text-shadow: none !important;
    font-size: 11pt !important; /* Match terminal output font size (11pt from line 2407) */
}

.terminal-scene .alpha-video-item .video-title {
    text-shadow: none !important;
    font-size: 11pt !important; /* Match terminal output font size */
}

/* Alpha video item text sizing */
.terminal-scene .alpha-video-item > div:first-child > div {
    font-size: 9pt !important; /* Channel name and time ago - proportional to title */
}

.terminal-scene .alpha-video-item > div:last-child {
    font-size: 10pt !important; /* Alpha score row - proportional to title */
}

.terminal-scene .alpha-video-item > div:last-child > span {
    font-size: 10pt !important; /* All spans in alpha row */
}

/* Terminal scene text size overrides - FIXED sizes (no scaling) */
.terminal-scene .video-title-clickable {
    font-size: 11pt !important; /* Match terminal output */
    max-height: 32px !important; /* Increased to accommodate larger font */
}

.terminal-scene .video-meta-small {
    font-size: 9pt !important; /* Proportional to title */
}

/* Note: Removed nuclear override to allow inline font-size styles to work properly */

/* Remove glow border from Monitor 2 (YouTube player) in terminal scene */
.terminal-scene #overlay-2::after {
    box-shadow: none !important;
    opacity: 0 !important;
}

/* Remove any visible border from Monitor 2 overlay in terminal scene */
.terminal-scene #overlay-2 {
    border: none !important;
}

/* Remove border from iframe inside Monitor 2 in terminal scene */
.terminal-scene #overlay-2 iframe {
    border: none !important;
}

/* ============================================================================
   CHAT PANEL STYLES - Self-Contained Conversation UI
   ============================================================================ */

/* Chat Bullet Points */
.chat-bullet {
    display: block;
    margin: 6px 0;
    line-height: 1.4;
    color: #E0E0E0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

.chat-bullet-sub {
    margin-left: 20px;
}

/* Chat Paragraphs */
.chat-paragraph {
    display: block;
    margin: 4px 0;
    line-height: 1.6;
    color: #E0E0E0;
}

/* Chat Headings */
.chat-heading {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: #FFA500;
    margin: 12px 0 8px 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

/* Chat Code Blocks */
.chat-code-block {
    display: block;
    background: #1a1a1a;
    border: 1px solid #FFA500;
    border-radius: 4px;
    padding: 12px;
    margin: 8px 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.9em;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #E0E0E0;
}

/* Chat Inline Code */
.chat-code {
    background: #2a2a2a;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.9em;
    color: #FFA500;
}

/* Chat Bold */
.chat-bold {
    font-weight: 600;
    color: #FFA500;
}

/* Chat Italic */
.chat-italic {
    font-style: italic;
    color: #CCCCCC;
}

/* Chat Links */
.chat-link {
    color: #00aaff;
    text-decoration: underline;
    cursor: pointer;
}

.chat-link:hover {
    color: #33bbff;
}

/* Chat Video Links */
.chat-video-link {
    color: #00aaff;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 4px;
}

.chat-video-link:hover {
    color: #33bbff;
}

/* Chat Spacer (for empty lines) */
.chat-spacer {
    height: 8px;
}

/* ============================================================================
   BBS Documentation Scene Styles (Monochrome Green Terminal)
   ============================================================================ */

.bbs-docs-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 50; /* Above everything */
    display: none; /* Hidden by default */
}

.bbs-docs-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.bbs-container {
    width: 95%;
    height: 95%;
    max-width: 1400px;
    background: #000000;
    border: 2px solid #00ff00;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header header"
        "sidebar content"
        "footer footer";
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.3),
                inset 0 0 60px rgba(0, 255, 0, 0.05);
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    overflow: hidden;
}

/* BBS Header */
.bbs-header {
    grid-area: header;
    background: #000000;
    border-bottom: 2px solid #00ff00;
    border-radius: 8px 8px 0 0;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bbs-title {
    color: #00ff00;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11pt;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.8);
    letter-spacing: 0.1em;
}

.bbs-close-btn {
    background: transparent;
    border: 1px solid #00ff00;
    border-radius: 4px;
    color: #00ff00;
    padding: 4px 12px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9pt;
    transition: all 0.2s ease;
}

.bbs-close-btn:hover {
    background: #00ff00;
    color: #000000;
    box-shadow: 0 0 12px rgba(0, 255, 0, 0.6);
}

.bbs-close-btn:active {
    transform: scale(0.95);
}

/* BBS Sidebar (Table of Contents) */
.bbs-sidebar {
    grid-area: sidebar;
    background: #000000;
    border-right: 2px solid #00ff00;
    padding: 20px 15px;
    overflow-y: auto;
}

.bbs-toc-title {
    color: #00ff00;
    font-size: 9pt;
    text-align: center;
    margin-bottom: 2px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
}

.bbs-toc {
    margin-top: 15px;
}

.bbs-toc-item {
    display: block;
    color: rgba(0, 255, 0, 0.8);
    padding: 8px 12px;
    margin: 4px 0;
    text-decoration: none;
    font-size: 9pt;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bbs-toc-item:hover {
    color: #00ff00;
    border-left-color: #00ff00;
    background: rgba(0, 255, 0, 0.05);
    padding-left: 16px;
    text-shadow: 0 0 6px rgba(0, 255, 0, 0.4);
}

.bbs-toc-item.active {
    color: #00ff00;
    border-left-color: #00ff00;
    font-weight: bold;
    background: rgba(0, 255, 0, 0.08);
}

.bbs-toc-loading {
    color: rgba(0, 255, 0, 0.6);
    text-align: center;
    padding: 20px;
    font-size: 9pt;
}

/* BBS Content Area */
.bbs-content-wrapper {
    grid-area: content;
    position: relative;
    overflow: hidden;
}

.bbs-content {
    height: 100%;
    padding: 30px 40px;
    overflow-y: auto;
    overflow-x: auto;
    line-height: 1.6;
    color: #00ff00;
    font-size: 11pt;
    letter-spacing: 0.02em;
}

.bbs-loading,
.bbs-error {
    color: #00ff00;
    text-align: center;
    padding: 60px 20px;
    font-size: 10pt;
    line-height: 1.4;
}

.bbs-error {
    color: rgba(255, 0, 0, 0.8);
}

/* BBS Content - Markdown Styling (Monochrome Green) */
.bbs-content h1 {
    color: #00ff00;
    font-size: 16pt;
    font-weight: bold;
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 255, 0, 0.5);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.bbs-content h2 {
    color: #00ff00;
    font-size: 14pt;
    font-weight: bold;
    margin: 30px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

.bbs-content h2::before {
    content: "▸ ";
    color: #00ffaa;
}

.bbs-content h3 {
    color: #00ff00;
    font-size: 12pt;
    font-weight: bold;
    margin: 20px 0 10px 0;
}

.bbs-content h3::before {
    content: "• ";
}

.bbs-content h4 {
    color: rgba(0, 255, 0, 0.9);
    font-size: 11pt;
    font-weight: bold;
    margin: 15px 0 8px 0;
}

.bbs-content p {
    margin: 12px 0;
    color: rgba(0, 255, 0, 0.9);
}

.bbs-content strong {
    color: #00ff00;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 255, 0, 0.3);
}

.bbs-content em {
    color: #00ffaa;
    font-style: italic;
}

.bbs-content code {
    background: rgba(0, 255, 0, 0.08);
    color: #00ffaa;
    padding: 2px 6px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    border-radius: 3px;
    font-size: 10pt;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.bbs-content pre {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.3);
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
    border-radius: 4px;
}

.bbs-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: rgba(0, 255, 0, 0.85);
}

.bbs-content ul,
.bbs-content ol {
    margin: 12px 0 12px 20px;
    color: rgba(0, 255, 0, 0.85);
    list-style-position: outside;
}

.bbs-content ul {
    list-style-type: '> ';
}

.bbs-content li {
    margin: 6px 0;
    padding-left: 0;
}

.bbs-content li::marker {
    color: #00ffaa;
}

.bbs-content blockquote {
    border-left: 3px solid #00ff00;
    padding-left: 15px;
    margin: 15px 0;
    color: rgba(0, 255, 0, 0.75);
    font-style: italic;
}

.bbs-content a {
    color: #00ffaa;
    text-decoration: underline;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bbs-content a:hover {
    color: #00ff00;
    text-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
}

.bbs-content table {
    border-collapse: collapse;
    margin: 15px 0;
    width: 100%;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

.bbs-content th {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    padding: 8px 12px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    font-weight: bold;
    text-align: left;
}

.bbs-content td {
    padding: 8px 12px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    color: rgba(0, 255, 0, 0.85);
}

.bbs-content tr:nth-child(even) {
    background: rgba(0, 255, 0, 0.02);
}

.bbs-content hr {
    border: none;
    border-top: 1px solid rgba(0, 255, 0, 0.3);
    margin: 20px 0;
}

/* Preserve ASCII art boxes */
.bbs-content pre.ascii-art {
    font-family: 'Courier New', monospace;
    letter-spacing: 0;
    line-height: 1.2;
    color: #00ff00;
    background: transparent;
    border: none;
}

/* BBS Scrollbar (Green theme) */
.bbs-content::-webkit-scrollbar,
.bbs-sidebar::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.bbs-content::-webkit-scrollbar-track,
.bbs-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.bbs-content::-webkit-scrollbar-thumb,
.bbs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 0, 0.6);
    border-radius: 5px;
}

.bbs-content::-webkit-scrollbar-thumb:hover,
.bbs-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 0, 0.9);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.4);
}

/* BBS Scrollbar Corner (where horizontal and vertical meet) */
.bbs-content::-webkit-scrollbar-corner,
.bbs-sidebar::-webkit-scrollbar-corner {
    background: rgba(0, 255, 0, 0.05);
}

/* BBS Footer */
.bbs-footer {
    grid-area: footer;
    background: #000000;
    border-top: 2px solid #00ff00;
    border-radius: 0 0 8px 8px;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9pt;
}

.bbs-status {
    color: #00ff00;
    font-weight: bold;
}

.bbs-status::before {
    content: "● ";
    animation: blink-green 2s infinite;
}

.bbs-info {
    color: rgba(0, 255, 0, 0.7);
}

/* Green blink animation */
@keyframes blink-green {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ==========================================
   TERMINAL SOURCES TABLE - Star Trek Modern Panel
   ========================================== */

.terminal-sources-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 12px 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.15),
                inset 0 0 20px rgba(0, 170, 255, 0.03);
    border: 1px solid rgba(0, 170, 255, 0.3);
}

.terminal-sources-table th {
    text-align: left;
    padding: 10px 12px;
    color: #00AAFF;
    font-weight: 600;
    background: rgba(0, 170, 255, 0.08);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.8px;
    border-bottom: 2px solid rgba(0, 170, 255, 0.3);
    box-shadow: inset 0 -2px 10px rgba(0, 170, 255, 0.08);
}

.terminal-sources-table thead tr th:first-child {
    border-top-left-radius: 11px;
}

.terminal-sources-table thead tr th:last-child {
    border-top-right-radius: 11px;
}

.terminal-sources-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #E0E0E0;
    vertical-align: middle;
}

.terminal-sources-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 11px;
}

.terminal-sources-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 11px;
}

.terminal-sources-table tbody tr:last-child td {
    border-bottom: none;
}

.terminal-sources-table tbody tr:hover td {
    background: rgba(0, 170, 255, 0.08);
    box-shadow: inset 0 0 15px rgba(0, 170, 255, 0.06);
    transition: all 0.2s ease;
}

/* Column 1: # (Number) - narrow, orange */
.terminal-sources-table td:first-child,
.terminal-sources-table th:first-child {
    color: #FFA500;
    text-align: center;
    width: 40px;
    font-weight: bold;
}

/* Column 2: CHANNEL - narrow, gray */
.terminal-sources-table td:nth-child(2),
.terminal-sources-table th:nth-child(2) {
    width: 150px;
    color: #E0E0E0;
}

/* Column 3: QUOTE - flexible width, gray */
.terminal-sources-table td:nth-child(3),
.terminal-sources-table th:nth-child(3) {
    width: auto;
    min-width: 200px;
}

.terminal-sources-table .quote-cell {
    color: rgba(224, 224, 224, 0.85);
    font-style: italic;
    line-height: 1.4;
}

/* Column 4: PUBLISHED - medium, orange */
.terminal-sources-table td:nth-child(4),
.terminal-sources-table th:nth-child(4) {
    width: 100px;
    text-align: center;
}

.terminal-sources-table .published-cell {
    color: #FFA500;
    font-weight: 500;
}

/* Column 5: TIME - narrow, blue */
.terminal-sources-table td:last-child,
.terminal-sources-table th:last-child {
    color: #00AAFF;
    text-align: right;
    width: 80px;
    font-weight: bold;
}

/* Timestamp link styling - glowing blue */
.terminal-sources-table .timestamp-link {
    color: #00AAFF;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.terminal-sources-table .timestamp-link:hover {
    color: #00EEFF;
    background: rgba(0, 170, 255, 0.15);
    text-shadow: 0 0 10px rgba(0, 238, 255, 0.6);
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.3);
}
