/* 80s-90s Arcade Horror Sound Panel */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-quaternary: #0f1419;
    
    --neon-cyan: #00e5ff;
    --neon-magenta: #e91e63;
    --neon-yellow: #ffeb3b;
    --neon-green: #4caf50;
    --neon-orange: #ff9800;
    --neon-red: #f44336;
    --neon-purple: #9c27b0;
    --neon-blue: #2196f3;
    
    --text-primary: #ffffff;
    --text-secondary: #b0bec5;
    --text-accent: #00e5ff;
    --text-glow: #00e5ff;
    
    --border-neon: #00e5ff;
    --shadow-neon: 0 0 20px;
    --shadow-intense: 0 0 40px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Enhanced gradients */
    --gradient-cyber: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-sunset: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
    --gradient-neon: linear-gradient(45deg, #e91e63, #00e5ff, #ffeb3b, #e91e63);
    --gradient-dark: linear-gradient(145deg, #0a0a0f, #1a1a2e);
    --gradient-glow: radial-gradient(ellipse at center, rgba(0, 229, 255, 0.1), transparent 70%);
    
    /* Animation keyframes */
    --pulse-duration: 2s;
    --scan-duration: 3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Rajdhani', 'Courier New', monospace;
    background: 
        radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0a 70%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 255, 0.03) 2px,
            rgba(0, 255, 255, 0.03) 4px
        );
    color: var(--text-primary);
    
    /* CRÍTICO: Exactamente la altura del viewport, no más */
    height: 100vh; /* Exactamente la ventana, no crece */
    width: 100%;
    
    /* Usar flexbox para organizar contenido */
    display: flex;
    flex-direction: column;
    
    /* Sin padding que cause overflow */
    margin: 0;
    padding: 0;
    
    /* IMPORTANTE: No permitir scroll de página */
    overflow: hidden;
    
    position: relative;
}

/* Retro scanlines effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.05) 2px,
        rgba(0, 255, 255, 0.05) 4px
    );
    pointer-events: none;
    z-index: 1;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.container {
    /* CRÍTICO: Ocupar exactamente todo el body sin crecer */
    flex: 1;
    display: flex;
    flex-direction: column;
    
    /* Dimensiones exactas del viewport */
    width: 100%;
    height: 100%; /* Llenar el body exactamente */
    
    /* Sin padding ni margin */
    margin: 0;
    padding: 0;
    
    /* No permitir overflow */
    overflow: hidden;
    
    position: relative;
    z-index: 2;
}

/* Header - Tamaño fijo para control total */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    padding: 0 20px;
    
    /* Flex que no crece */
    flex: 0 0 auto;
    
    transition: all 0.3s ease;
    overflow: hidden;
    
    background: 
        linear-gradient(145deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.95)),
        var(--gradient-glow);
    
    /* 80s beveled border effect */
    border-top: 3px solid rgba(0, 229, 255, 0.8);
    border-left: 3px solid rgba(0, 229, 255, 0.8);
    border-right: 3px solid rgba(0, 150, 200, 0.6);
    border-bottom: 3px solid rgba(0, 100, 150, 0.6);
    
    /* Sharp 80s corners instead of rounded */
    border-radius: 0;
    
    box-shadow: 
        /* Outer glow */
        0 0 20px rgba(0, 229, 255, 0.3),
        /* Inner beveled highlight */
        inset 2px 2px 4px rgba(0, 229, 255, 0.2),
        inset -2px -2px 4px rgba(0, 100, 150, 0.3),
        /* Drop shadow */
        4px 4px 12px rgba(0, 0, 0, 0.6);
    
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(0, 229, 255, 0.1) 1px,
        rgba(0, 229, 255, 0.1) 2px
    );
    pointer-events: none;
}

.header.hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    box-shadow: none;
    opacity: 0;
    pointer-events: none;
}

/* Mostrar indicador cuando está oculto */
.container::before {
    content: '▼ Tap to show header';
    display: none;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 229, 255, 0.9);
    color: var(--bg-primary);
    padding: 4px 12px;
    font-size: 0.75rem;
    font-family: 'Orbitron', monospace;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.5);
    z-index: 1001;
    cursor: pointer;
    transition: all 0.3s ease;
}

.container.header-hidden::before {
    display: block;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0;
    padding: 8px 16px; /* Add padding for better visual spacing */
    text-shadow: 
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-magenta), var(--neon-cyan));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    position: relative;
}

@keyframes neon-flicker {
    0%, 100% { 
        text-shadow: 
            0 0 5px var(--neon-cyan),
            0 0 10px var(--neon-cyan),
            0 0 15px var(--neon-cyan),
            0 0 20px var(--neon-cyan);
    }
    50% { 
        text-shadow: 
            0 0 2px var(--neon-cyan),
            0 0 5px var(--neon-cyan),
            0 0 8px var(--neon-cyan),
            0 0 12px var(--neon-cyan);
    }
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-button {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    color: var(--neon-yellow);
    border: 2px solid var(--neon-yellow);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 5px var(--neon-yellow);
    box-shadow: 
        0 0 10px rgba(255, 255, 0, 0.3),
        inset 0 0 10px rgba(255, 255, 0, 0.1);
}

.control-button:hover {
    background: linear-gradient(145deg, var(--neon-yellow), #ffff44);
    color: var(--bg-primary);
    border-color: #ffff88;
    transform: scale(1.05);
    box-shadow: 
        0 0 20px rgba(255, 255, 0, 0.6),
        inset 0 0 20px rgba(255, 255, 0, 0.2);
    text-shadow: none;
}

.panic-button {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(145deg, #330000, #660000);
    color: var(--neon-red);
    border: 3px solid var(--neon-red);
    border-radius: 10px;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition);
    text-shadow: 0 0 10px var(--neon-red);
    box-shadow: 
        0 0 20px rgba(255, 0, 64, 0.5),
        inset 0 0 20px rgba(255, 0, 64, 0.1);
    animation: danger-pulse 2s infinite;
}

@keyframes danger-pulse {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(255, 0, 64, 0.5),
            inset 0 0 20px rgba(255, 0, 64, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(255, 0, 64, 0.8),
            inset 0 0 30px rgba(255, 0, 64, 0.2);
    }
}

.panic-button:hover {
    background: linear-gradient(145deg, var(--neon-red), #ff4477);
    color: var(--bg-primary);
    transform: scale(1.08);
    animation: none;
    box-shadow: 
        0 0 40px rgba(255, 0, 64, 0.9),
        inset 0 0 40px rgba(255, 0, 64, 0.3);
}

/* Main Content - Grid que ocupa exactamente el espacio restante */
.main-content {
    /* CRÍTICO: Ocupar todo el espacio restante después del header */
    flex: 1;
    
    /* Grid para dividir en sidebar + contenido */
    display: grid;
    grid-template-columns: 300px 1fr;
    
    /* Sin gaps para aprovechar todo el espacio */
    gap: 0;
    
    /* IMPORTANTE: Altura exacta, no exceder el contenedor */
    height: 100%; /* Llenar el flex space exactamente */
    
    /* No permitir overflow de la estructura principal */
    overflow: hidden;
    
    /* Fundamental para que grid funcione en contenedor flex */
    min-height: 0;
    
    /* Sin margin ni padding */
    margin: 0;
    padding: 0;
}

/* Sidebar - Sin overflow, altura controlada */
.audio-panel {
    background: 
        linear-gradient(180deg, rgba(35, 35, 55, 0.98), rgba(25, 25, 45, 0.98)),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 1px,
            rgba(0, 229, 255, 0.05) 1px,
            rgba(0, 229, 255, 0.05) 2px
        );
    
    /* 80s beveled panel border */
    border-top: 3px solid rgba(0, 229, 255, 0.4);
    border-left: 3px solid rgba(0, 229, 255, 0.4);
    border-right: 3px solid rgba(0, 150, 200, 0.8);
    border-bottom: 3px solid rgba(0, 100, 150, 0.8);
    
    /* Flexbox vertical para organizar controles */
    display: flex;
    flex-direction: column;
    gap: 8px; /* Menos gap para evitar overflow */
    
    padding: 12px; /* Menos padding para evitar overflow */
    
    /* CRÍTICO: Usar box-sizing border-box para incluir padding/border en la altura */
    box-sizing: border-box;
    
    /* CLAVE: Altura exacta del grid, scroll interno cuando necesario */
    height: 100%; /* Llenar exactamente la celda del grid */
    
    /* Scroll interno cuando sea necesario */
    overflow-y: auto;
    overflow-x: hidden;
    
    /* Importante: min-height 0 para que flexbox funcione correctamente */
    min-height: 0;
    
    box-shadow: 
        inset 2px 2px 4px rgba(0, 229, 255, 0.1),
        inset -2px -2px 4px rgba(0, 0, 0, 0.4),
        3px 0 15px rgba(0, 229, 255, 0.2);
}

.audio-panel::-webkit-scrollbar {
    width: 6px;
}

.audio-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.audio-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-magenta));
    border-radius: 3px;
    opacity: 0.8;
}

.audio-panel::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* Professional Scene Panel - Fill Grid Cell Exactly */
.scene-panel {
    /* Altura exacta de la celda del grid */
    height: 100%; /* Llenar exactamente la celda del grid */
    
    /* Usar flexbox para distribuir espacio perfectamente */
    display: flex;
    flex-direction: column;
    
    /* Sin padding para maximizar espacio */
    padding: 0;
    
    /* Scroll interno cuando el contenido exceda */
    overflow-y: auto;
    overflow-x: hidden;
    
    background: 
        radial-gradient(ellipse 600px 400px at 50% 0%, rgba(0, 229, 255, 0.03), transparent 70%),
        linear-gradient(135deg, rgba(10, 10, 15, 0.8), rgba(26, 26, 46, 0.6));
    backdrop-filter: blur(5px);
}

/* Secciones de audio - Tamaño controlado */
.audio-panel section {
    background: 
        linear-gradient(145deg, rgba(45, 45, 65, 0.95), rgba(35, 35, 55, 0.95)),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 2px,
            rgba(0, 229, 255, 0.03) 2px,
            rgba(0, 229, 255, 0.03) 3px
        );
    
    /* 80s recessed panel effect */
    border-top: 2px solid rgba(0, 0, 0, 0.6);
    border-left: 2px solid rgba(0, 0, 0, 0.6);
    border-right: 2px solid rgba(0, 229, 255, 0.3);
    border-bottom: 2px solid rgba(0, 229, 255, 0.3);
    
    border-radius: 0;
    padding: 12px; /* Menos padding */
    margin-bottom: 6px; /* Menos margen */
    
    /* Box sizing para control preciso del tamaño */
    box-sizing: border-box;
    
    /* IMPORTANTE: No crecer más de lo necesario */
    flex: 0 0 auto;
    
    /* Prevenir overflow interno */
    overflow: hidden;
    
    box-shadow: 
        inset 1px 1px 3px rgba(0, 0, 0, 0.5),
        inset -1px -1px 3px rgba(0, 229, 255, 0.1),
        0 0 8px rgba(0, 229, 255, 0.1);
    
    position: relative;
    transition: var(--transition);
}

/* BGM and SFX Sections - Flexible Height Control */
.bgm-section, .sfx-section {
    display: flex;
    flex-direction: column;
    
    /* FLEXIBLE: Permitir crecer y encogerse según espacio disponible */
    flex: 1 1 auto !important; /* grow, shrink, basis auto */
    
    /* Overflow interno con scroll cuando necesario */
    overflow: hidden;
    transition: min-height 0.3s ease;
}

/* When section has collapsed content, remove min-height */
.bgm-section:has(.collapsible-content.collapsed),
.sfx-section:has(.collapsible-content.collapsed) {
    min-height: 0;
    flex: 0 0 auto;
}

/* When expanded, set min-height */
.bgm-section:not(:has(.collapsible-content.collapsed)),
.sfx-section:not(:has(.collapsible-content.collapsed)) {
    min-height: 200px;
}

.bgm-section h2, .sfx-section h2 {
    flex-shrink: 0; /* Header no se reduce */
    margin: 0 0 8px 0;
}

/* Collapsible section headers */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
    padding-right: 30px;
}

.collapsible-header::after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.collapsible-header.collapsed::after {
    transform: translateY(-50%) rotate(-90deg);
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    max-height: 5000px;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

/* Make audio grids inside BGM/SFX sections scrollable */
.bgm-section .audio-grid, .sfx-section .audio-grid {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Allow shrinking */
}

/* When collapsed, audio grids don't take space */
.bgm-section .audio-grid.collapsed, 
.sfx-section .audio-grid.collapsed {
    flex: 0;
}

/* When expanded, audio grids take remaining space */
.bgm-section .audio-grid:not(.collapsed), 
.sfx-section .audio-grid:not(.collapsed) {
    flex: 1;
}

/* Reference tabs section - fixed height */
.ref-tabs-section {
    flex: 0 0 auto; /* Fixed size - no grow, no shrink */
    margin-bottom: 8px;
    /* Height determined by content */
}

.audio-panel section:hover {
    border-right-color: rgba(0, 229, 255, 0.5);
    border-bottom-color: rgba(0, 229, 255, 0.5);
    
    box-shadow: 
        inset 1px 1px 3px rgba(0, 0, 0, 0.5),
        inset -1px -1px 3px rgba(0, 229, 255, 0.2),
        0 0 12px rgba(0, 229, 255, 0.2);
}

/* Authentic 80s Monitor Scene Panel - Fixed Overflow */
.scene-panel section {
    background: 
        /* 80s monitor screen effect */
        linear-gradient(145deg, rgba(15, 20, 15, 0.98), rgba(20, 25, 20, 0.98)),
        radial-gradient(ellipse at center, rgba(0, 255, 0, 0.03), transparent 80%),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 1px,
            rgba(0, 255, 0, 0.02) 1px,
            rgba(0, 255, 0, 0.02) 2px
        );
    
    /* 80s CRT monitor bezel */
    border-top: 4px solid rgba(100, 100, 120, 0.8);
    border-left: 4px solid rgba(100, 100, 120, 0.8);
    border-right: 4px solid rgba(40, 40, 50, 0.9);
    border-bottom: 4px solid rgba(30, 30, 40, 0.9);
    
    /* Sharp corners for authentic look */
    border-radius: 0;
    
    padding: 20px;
    margin: 0;
    
    /* CRÍTICO: Ocupar toda la altura disponible del scene-panel */
    flex: 1;
    display: flex;
    flex-direction: column;
    
    /* Control de overflow interno */
    min-height: 0;
    
    box-shadow: 
        /* Screen bezel effect */
        inset 3px 3px 6px rgba(100, 100, 120, 0.2),
        inset -3px -3px 6px rgba(0, 0, 0, 0.6),
        /* Screen glow */
        0 0 20px rgba(0, 255, 0, 0.1),
        /* Outer shadow */
        6px 6px 20px rgba(0, 0, 0, 0.5);
    
    position: relative;
    
    /* Flexbox que ocupa el espacio disponible */
    flex: 1;
    display: flex;
    flex-direction: column;
    
    /* Permitir que el contenido interno tenga scroll */
    min-height: 0;
    
    transition: var(--transition);
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--neon-cyan) 0%, 
        var(--neon-magenta) 25%, 
        var(--neon-yellow) 50%, 
        var(--neon-green) 75%, 
        var(--neon-cyan) 100%);
    animation: rainbow-border 3s linear infinite;
}

@keyframes rainbow-border {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Headers de secciones - Compactos */
.audio-panel section h2 {
    font-family: 'Orbitron', 'Courier New', monospace;
    font-size: 0.8rem; /* Más pequeño */
    font-weight: 700;
    color: var(--neon-cyan);
    margin-bottom: 8px; /* Menos margen */
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    text-shadow: 
        0 0 4px var(--neon-cyan),
        0 0 8px var(--neon-cyan),
        1px 1px 2px rgba(0, 0, 0, 0.8);
    
    position: relative;
    border-bottom: 1px solid rgba(0, 229, 255, 0.5);
    padding-bottom: 3px; /* Menos padding */
    
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 1px,
        rgba(0, 229, 255, 0.03) 1px,
        rgba(0, 229, 255, 0.03) 2px
    );
}

/* Scene section header - larger CRT monitor style */
.scene-panel section h2 {
    font-family: 'Orbitron', 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--neon-green);
    margin: 0 0 15px 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    
    /* IMPORTANTE: Tamaño fijo, no crecer */
    flex-shrink: 0;
    
    /* 80s CRT monitor glow */
    text-shadow: 
        0 0 6px var(--neon-green),
        0 0 12px var(--neon-green),
        0 0 18px var(--neon-green),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    
    position: relative;
    
    /* CRT scanline effect */
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(0, 255, 0, 0.05) 1px,
        rgba(0, 255, 0, 0.05) 2px
    );
    
    /* Monitor-style underline */
    border-bottom: 2px solid rgba(0, 255, 0, 0.6);
    padding-bottom: 8px;
}

/* Audio Button Grids - Sidebar with Scrollable Sections */
.audio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 8px;
    
    /* CRÍTICO: Control de altura y scroll para evitar overflow */
    overflow-y: auto;
    overflow-x: hidden;
    
    /* Scroll suave y oculto hasta hover */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 229, 255, 0.5) transparent;
}

/* Custom scrollbar for audio grids */
.audio-grid::-webkit-scrollbar {
    width: 6px;
}

.audio-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.audio-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--neon-cyan), var(--neon-magenta));
    border-radius: 3px;
    opacity: 0.7;
}

.audio-grid::-webkit-scrollbar-thumb:hover {
    opacity: 1;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

/* Retro Arcade Audio Buttons */
.audio-button {
    font-family: 'Orbitron', monospace;
    background: 
        linear-gradient(145deg, rgba(50, 50, 70, 1), rgba(35, 35, 55, 1)),
        linear-gradient(145deg, rgba(0, 229, 255, 0.1), transparent 70%);
    color: var(--neon-cyan);
    
    /* 80s beveled button borders */
    border-top: 2px solid rgba(0, 229, 255, 0.6);
    border-left: 2px solid rgba(0, 229, 255, 0.6);
    border-right: 2px solid rgba(0, 150, 200, 0.8);
    border-bottom: 2px solid rgba(0, 100, 150, 0.8);
    
    /* Sharp corners for authentic 80s look */
    border-radius: 0;
    
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 8px var(--neon-cyan);
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    
    box-shadow: 
        /* Outer glow */
        0 0 8px rgba(0, 229, 255, 0.2),
        /* Inner beveled effect */
        inset 1px 1px 2px rgba(255, 255, 255, 0.1),
        inset -1px -1px 2px rgba(0, 0, 0, 0.3),
        /* Drop shadow */
        2px 2px 6px rgba(0, 0, 0, 0.4);
}

/* Arcade button LED effect */
.audio-button::before {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-green);
    opacity: 0.6;
}

.audio-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.audio-button:hover {
    background: 
        linear-gradient(145deg, var(--neon-green), #66ff44),
        radial-gradient(ellipse at center, rgba(57, 255, 20, 0.2), transparent 60%);
    color: var(--bg-primary);
    border-color: #66ff44;
    transform: scale(1.05);
    text-shadow: none;
    box-shadow: 
        0 0 25px rgba(57, 255, 20, 0.6),
        inset 0 0 30px rgba(57, 255, 20, 0.2);
}

.audio-button:hover::after {
    transform: translateX(100%);
}

.audio-button:active {
    transform: scale(0.95);
    box-shadow: 
        0 0 30px rgba(57, 255, 20, 0.8),
        inset 0 0 40px rgba(57, 255, 20, 0.3);
}

/* BGM specific styling - Arcade Style */
.bgm-button.playing {
    background: 
        linear-gradient(145deg, var(--neon-cyan), #44ddff),
        radial-gradient(ellipse at center, rgba(0, 255, 255, 0.3), transparent 60%);
    color: var(--bg-primary);
    border-color: var(--neon-cyan);
    text-shadow: none;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.8),
        inset 0 0 30px rgba(0, 255, 255, 0.2);
    animation: cyber-pulse 2s infinite;
}

.bgm-button.playing::before {
    background: var(--neon-cyan);
    box-shadow: 0 0 15px var(--neon-cyan);
    opacity: 1;
}

.bgm-button.paused {
    background: 
        linear-gradient(145deg, var(--neon-orange), #ff8844),
        radial-gradient(ellipse at center, rgba(255, 102, 0, 0.2), transparent 60%);
    color: var(--bg-primary);
    border-color: var(--neon-orange);
    text-shadow: none;
    box-shadow: 
        0 0 20px rgba(255, 102, 0, 0.6),
        inset 0 0 20px rgba(255, 102, 0, 0.1);
}

.bgm-button.paused::before {
    background: var(--neon-orange);
    box-shadow: 0 0 15px var(--neon-orange);
    opacity: 1;
}

.bgm-button.fading {
    animation: fade-transition 1s ease-in-out;
    opacity: 0.8;
}

/* SFX specific styling - Arcade Style */
.sfx-button.playing {
    background: 
        linear-gradient(145deg, var(--neon-magenta), #ff44ff),
        radial-gradient(ellipse at center, rgba(255, 0, 255, 0.3), transparent 60%);
    color: var(--bg-primary);
    border-color: var(--neon-magenta);
    text-shadow: none;
    box-shadow: 
        0 0 25px rgba(255, 0, 255, 0.8),
        inset 0 0 25px rgba(255, 0, 255, 0.2);
    animation: arcade-flash 0.8s ease-out;
}

.sfx-button.playing::before {
    background: var(--neon-magenta);
    box-shadow: 0 0 15px var(--neon-magenta);
    opacity: 1;
}

@keyframes cyber-pulse {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(0, 255, 255, 0.8),
            inset 0 0 30px rgba(0, 255, 255, 0.2);
        transform: scale(1.05);
    }
    50% { 
        box-shadow: 
            0 0 40px rgba(0, 255, 255, 1),
            inset 0 0 40px rgba(0, 255, 255, 0.3);
        transform: scale(1.08);
    }
}

@keyframes arcade-flash {
    0% { 
        background: 
            linear-gradient(145deg, var(--neon-magenta), #ff44ff),
            radial-gradient(ellipse at center, rgba(255, 0, 255, 0.3), transparent 60%);
        transform: scale(1.05);
    }
    30% { 
        background: 
            linear-gradient(145deg, #ffffff, #ff88ff),
            radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5), transparent 60%);
        transform: scale(1.1);
    }
    100% { 
        background: 
            linear-gradient(145deg, #1a1a2e, #16213e),
            radial-gradient(ellipse at center, rgba(0, 255, 255, 0.1), transparent 60%);
        transform: scale(1);
    }
}

@keyframes neon-glow {
    0%, 100% { filter: brightness(1) saturate(1); }
    50% { filter: brightness(1.2) saturate(1.3); }
}

.bgm-button.fading {
    animation: neon-glow 1s ease-in-out;
    filter: brightness(1.1);
}

/* BGM Button Crossfade Animations */
.bgm-button {
    /* Enhanced transition for smooth color crossfades */
    transition: 
        var(--transition-fast),
        background 0.05s linear,
        color 0.05s linear,
        border-color 0.05s linear,
        box-shadow 0.05s linear;
}

.bgm-button.transitioning {
    /* Smooth visual feedback during crossfade with subtle scale */
    transform: scale(1.01);
    transition: 
        background 0.05s linear,
        color 0.05s linear,
        border-color 0.05s linear,
        box-shadow 0.05s linear,
        transform 0.1s ease-out;
}

/* Reference Tabs Section - 80s Style Horizontal Tabs */
.ref-tabs-section {
    margin-bottom: 8px;
}

.ref-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px 0;
}

.ref-tab {
    background: linear-gradient(145deg, rgba(25, 25, 45, 0.9), rgba(15, 15, 35, 0.9));
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 0.8rem;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 0;
}

.ref-tab:hover {
    background: linear-gradient(145deg, rgba(35, 35, 55, 0.9), rgba(25, 25, 45, 0.9));
    border-color: rgba(0, 229, 255, 0.6);
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.ref-tab.active {
    background: linear-gradient(145deg, rgba(0, 229, 255, 0.2), rgba(0, 150, 200, 0.2));
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

/* Reference Overlay - Slide-over Display */
.ref-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ref-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ref-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    background: 
        linear-gradient(145deg, rgba(25, 25, 45, 0.98), rgba(15, 15, 35, 0.98)),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 1px,
            rgba(0, 229, 255, 0.05) 1px,
            rgba(0, 229, 255, 0.05) 2px
        );
    
    border-left: 3px solid var(--neon-cyan);
    box-shadow: 
        -5px 0 20px rgba(0, 0, 0, 0.5),
        inset 2px 0 8px rgba(0, 229, 255, 0.1);
    
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.ref-content-wide {
    width: 90%;
}

.ref-overlay.active .ref-content {
    transform: translateX(0);
}

.ref-body {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    min-height: 0;
    overflow: hidden;
}

.ref-list {
    border-right: 2px solid rgba(0, 229, 255, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    background: linear-gradient(180deg, rgba(20,20,40,0.8), rgba(10,10,20,0.8));
}

.ref-list-item {
    width: 100%;
    text-align: left;
    background: linear-gradient(145deg, rgba(25, 25, 45, 0.9), rgba(15, 15, 35, 0.9));
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--text-secondary);
    padding: 8px 10px;
    font-size: 0.9rem;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.ref-list-item:hover {
    border-color: rgba(0, 229, 255, 0.6);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.ref-list-item.active {
    background: linear-gradient(145deg, rgba(0, 229, 255, 0.2), rgba(0, 150, 200, 0.2));
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.ref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid rgba(0, 229, 255, 0.3);
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.1), transparent);
}

.ref-title {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.ref-close-btn {
    background: transparent;
    border: 2px solid var(--neon-red);
    color: var(--neon-red);
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: monospace;
}

.ref-close-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    text-shadow: 0 0 8px var(--neon-red);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.5);
}

.ref-display {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    color: var(--text-primary);
    font-family: 'Rajdhani', monospace;
    font-size: 1.1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.ref-display pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    max-width: 100%;
}

.ref-display.ref-preview {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: rgba(0,0,0,0.3);
}

/* Markdown content styling */
.ref-display.markdown-display {
    padding: 30px;
}

.markdown-content {
    max-width: 100%;
    color: var(--text-primary);
    line-height: 1.7;
}

.markdown-content h1 {
    color: var(--neon-cyan);
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-cyan);
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(0, 229, 255, 0.3);
}

.markdown-content h2 {
    color: var(--neon-magenta);
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px var(--neon-magenta);
    margin: 25px 0 15px 0;
}

.markdown-content h3 {
    color: var(--neon-yellow);
    font-family: 'Rajdhani', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.markdown-content p {
    margin: 0 0 15px 0;
    font-size: 1.05rem;
}

.markdown-content ul, .markdown-content ol {
    margin: 10px 0 15px 20px;
    padding-left: 20px;
}

.markdown-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.markdown-content strong {
    color: var(--neon-cyan);
    font-weight: 600;
}

.markdown-content em {
    color: var(--text-accent);
    font-style: italic;
}

.markdown-content code {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: var(--neon-green);
}

.markdown-content pre {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 229, 255, 0.3);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 15px 0;
}

.markdown-content pre code {
    background: none;
    border: none;
    padding: 0;
}

.markdown-content hr {
    border: none;
    border-top: 2px solid rgba(0, 229, 255, 0.3);
    margin: 20px 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--neon-magenta);
    padding-left: 15px;
    margin: 15px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.markdown-content th, .markdown-content td {
    border: 1px solid rgba(0, 229, 255, 0.3);
    padding: 10px;
    text-align: left;
}

.markdown-content th {
    background: rgba(0, 229, 255, 0.2);
    color: var(--neon-cyan);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.markdown-content tr:nth-child(even) {
    background: rgba(0, 229, 255, 0.05);
}

.ref-media-image, .ref-media-video {
    max-width: 100%;
    height: auto;
    border: 2px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

@media (max-width: 900px) {
    .ref-content, .ref-content-wide {
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-left: none;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .ref-body {
        grid-template-columns: 1fr;
        overflow: hidden;
        height: 100%;
    }
    .ref-list {
        display: none;
    }
    .ref-header {
        padding: 15px;
        flex-shrink: 0;
    }
    .ref-display, .ref-display.ref-preview {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 15px;
    }
}

/* Enhanced Map Display - ASCII Art with 80s Terminal Effects */
.ref-display.map-display {
    background: 
        linear-gradient(145deg, rgba(5, 5, 15, 0.95), rgba(0, 0, 10, 0.98)),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 1px,
            rgba(0, 255, 0, 0.02) 1px,
            rgba(0, 255, 0, 0.02) 2px
        );
    
    border: 2px solid rgba(0, 255, 0, 0.3);
    border-radius: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: pre;
    color: var(--neon-green);
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.5);
}

.map-container {
    position: relative;
    padding: 10px;
    background: rgba(0, 20, 0, 0.3);
    border: 1px solid rgba(0, 255, 0, 0.2);
    animation: terminal-flicker 3s ease-in-out infinite alternate;
}

.map-line {
    position: relative;
    padding: 2px 0;
    min-height: 1.2em;
}

/* Map element styling with different neon colors */
.map-wall {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
    font-weight: bold;
}

.map-room {
    color: var(--neon-yellow);
    text-shadow: 0 0 6px var(--neon-yellow);
    font-weight: bold;
    text-transform: uppercase;
}

.map-special {
    color: var(--neon-magenta);
    text-shadow: 0 0 5px var(--neon-magenta);
    font-style: italic;
}

.map-detail {
    color: var(--neon-green);
    text-shadow: 0 0 4px var(--neon-green);
    opacity: 0.9;
}

/* Subtle terminal flicker animation */
@keyframes terminal-flicker {
    0%, 100% { 
        opacity: 1;
        text-shadow: 0 0 3px rgba(0, 255, 0, 0.5);
    }
    50% { 
        opacity: 0.98;
        text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    }
}

/* Scanline effect overlay for authentic CRT look */
.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.map-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.1) 100%
    );
    pointer-events: none;
    z-index: 2;
}

/* Volume section - Fija en la parte inferior */
.volume-section {
    padding: 10px; /* Menos padding para evitar overflow */
    
    /* Box sizing para control preciso */
    box-sizing: border-box;
    
    /* FIXED SIZE: Mantener tamaño fijo en la parte inferior */
    flex: 0 0 auto; /* No grow, no shrink, auto basis */
    transition: all 0.3s ease;
    
    background: 
        linear-gradient(145deg, rgba(60, 60, 80, 0.95), rgba(45, 45, 65, 0.95)),
        repeating-linear-gradient(
            45deg,
            transparent 0px,
            transparent 1px,
            rgba(0, 255, 0, 0.02) 1px,
            rgba(0, 255, 0, 0.02) 2px
        );
    
    /* 80s hardware panel borders */
    border-top: 2px solid rgba(0, 255, 0, 0.4);
    border-left: 2px solid rgba(0, 255, 0, 0.4);
    border-right: 2px solid rgba(0, 150, 0, 0.6);
    border-bottom: 2px solid rgba(0, 100, 0, 0.6);
    
    border-radius: 0;
    
    box-shadow: 
        inset 1px 1px 3px rgba(0, 255, 0, 0.1),
        inset -1px -1px 3px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(0, 255, 0, 0.2),
        2px 2px 8px rgba(0, 0, 0, 0.4);
}

.volume-section:has(.collapsible-content.collapsed) {
    padding: 10px 10px 0 10px;
}

.volume-group {
    display: flex;
    align-items: center;
    gap: 10px;
    
    background: 
        linear-gradient(145deg, rgba(25, 25, 35, 0.9), rgba(35, 35, 50, 0.8));
    
    padding: 10px 12px;
    
    /* 80s recessed control styling */
    border-top: 1px solid rgba(0, 0, 0, 0.8);
    border-left: 1px solid rgba(0, 0, 0, 0.8);
    border-right: 1px solid rgba(0, 229, 255, 0.4);
    border-bottom: 1px solid rgba(0, 229, 255, 0.4);
    
    /* Sharp corners */
    border-radius: 0;
    
    box-shadow: 
        /* Recessed effect */
        inset 1px 1px 2px rgba(0, 0, 0, 0.6),
        inset -1px -1px 2px rgba(0, 229, 255, 0.1);
    
    width: 100%;
    transition: var(--transition);
}

.volume-group:hover {
    border-right-color: rgba(0, 229, 255, 0.6);
    border-bottom-color: rgba(0, 229, 255, 0.6);
    
    box-shadow: 
        inset 1px 1px 2px rgba(0, 0, 0, 0.6),
        inset -1px -1px 2px rgba(0, 229, 255, 0.2);
}

.volume-group span {
    font-size: 1.5rem;
    min-width: 25px;
    text-shadow: 0 0 8px currentColor;
}

.volume-label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 30px;
}

.volume-group input[type="range"] {
    flex: 1;
    height: 12px;
    background: linear-gradient(90deg, var(--bg-primary), #2a2a4a);
    border: 2px solid var(--neon-cyan);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

.volume-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--neon-cyan), #0088aa);
    cursor: pointer;
    border: 3px solid var(--neon-cyan);
    box-shadow: 
        0 0 15px var(--neon-cyan),
        inset 0 0 10px rgba(0, 255, 255, 0.3);
}

.volume-group input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--neon-cyan), #0088aa);
    cursor: pointer;
    border: 3px solid var(--neon-cyan);
    box-shadow: 
        0 0 15px var(--neon-cyan),
        inset 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Scenes Section - Right Panel */
.scenes-section {
    background: 
        linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary)),
        radial-gradient(ellipse at center, rgba(255, 255, 0, 0.05), transparent 70%);
    border: 2px solid var(--neon-yellow);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.scene-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 10px 15px;
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.15);
    
    /* IMPORTANTE: Tamaño fijo, no crecer */
    flex-shrink: 0;
}

.scene-nav-btn {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    text-shadow: 0 0 5px var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.scene-nav-btn:hover:not(:disabled) {
    background: linear-gradient(145deg, var(--neon-cyan), #44ddff);
    color: var(--bg-primary);
    transform: scale(1.05);
    text-shadow: none;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.scene-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(145deg, #333, #555);
    color: #666;
    border-color: #555;
    text-shadow: none;
    box-shadow: none;
}

/* Scene image controls - Integrated into navigation bar */
.scene-image-btn-header {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    color: var(--neon-magenta);
    border: 1px solid var(--neon-magenta);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-shadow: 0 0 5px var(--neon-magenta);
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.2);
    min-width: 36px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.scene-image-btn-header:hover {
    background: linear-gradient(145deg, var(--neon-magenta), #ff4081);
    color: var(--bg-primary);
    transform: scale(1.1);
    text-shadow: none;
    box-shadow: 0 0 16px rgba(233, 30, 99, 0.5);
}

/* Responsive design for scene image button */
@media (max-width: 768px) {
    .scene-navigation {
        gap: 8px;
        margin-bottom: 6px;
        padding: 8px 12px;
    }
    
    .scene-image-btn-header {
        font-size: 1rem;
        min-width: 36px;
        height: 32px;
        padding: 6px 10px;
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .scene-image-btn-header {
        font-size: 1.1rem;
        min-width: 40px;
        height: 36px;
        padding: 8px 12px;
    }
    
    /* Add tooltip for mobile */
    .scene-image-btn-header::after {
        content: attr(title);
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 6px 10px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
        z-index: 1000;
        font-family: 'Rajdhani', sans-serif;
        font-weight: 400;
        text-shadow: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .scene-image-btn-header:hover::after,
    .scene-image-btn-header:active::after {
        opacity: 1;
    }
}

.scene-counter {
    font-family: 'Orbitron', monospace;
    color: var(--neon-yellow);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--neon-yellow);
    font-size: 1rem;
    background: transparent;
    border: 1px solid rgba(255, 235, 59, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.scene-counter:hover {
    background: rgba(255, 235, 59, 0.1);
    border-color: rgba(255, 235, 59, 0.6);
    box-shadow: 0 0 10px rgba(255, 235, 59, 0.3);
}

.scene-counter.active {
    background: rgba(255, 235, 59, 0.2);
    border-color: var(--neon-yellow);
    box-shadow: 0 0 15px rgba(255, 235, 59, 0.5);
}

.scene-counter-wrapper {
    position: relative;
    display: inline-block;
}

/* Scene Selector Dropdown */
.scene-selector-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: 400px;
    max-height: 400px;
    overflow-y: auto;
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 229, 255, 0.4), inset 0 0 20px rgba(0, 229, 255, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.scene-selector-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.scene-selector-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.scene-selector-item:last-child {
    border-bottom: none;
}

.scene-selector-item:hover {
    background: rgba(0, 229, 255, 0.15);
    padding-left: 20px;
}

.scene-selector-item.current {
    background: rgba(0, 229, 255, 0.25);
    border-left: 4px solid var(--neon-cyan);
    padding-left: 12px;
}

.scene-selector-item.current:hover {
    padding-left: 16px;
}

.scene-selector-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: rgba(0, 229, 255, 0.2);
    border: 1px solid rgba(0, 229, 255, 0.5);
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
    color: var(--neon-cyan);
    font-family: 'Orbitron', monospace;
}

.scene-selector-item.current .scene-selector-number {
    background: var(--neon-cyan);
    color: var(--bg-primary);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
}

.scene-selector-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.scene-selector-item.current .scene-selector-name {
    color: var(--neon-cyan);
    font-weight: 600;
}

/* Custom scrollbar for dropdown */
.scene-selector-dropdown::-webkit-scrollbar {
    width: 8px;
}

.scene-selector-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.scene-selector-dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.5);
    border-radius: 4px;
}

.scene-selector-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.8);
}

.scene-content {
    background: 
        linear-gradient(145deg, rgba(16, 20, 25, 0.95), rgba(22, 33, 62, 0.9)),
        radial-gradient(ellipse at center, rgba(255, 255, 0, 0.03), transparent 70%);
    border: 1px solid var(--neon-magenta);
    border-radius: 0;
    padding: 15px;
    
    /* CRÍTICO: Ocupar todo el espacio restante después del header y navegación */
    flex: 1;
    
    /* Usar flexbox para organizar title y description */
    display: flex;
    flex-direction: column;
    
    /* Control de overflow interno */
    min-height: 0;
    overflow: hidden;
    
    /* Espaciado */
    margin-top: 10px;
    
    box-shadow: 
        0 0 8px rgba(255, 0, 255, 0.15),
        inset 0 0 15px rgba(255, 0, 255, 0.03);
}

.scene-title {
    font-family: 'Orbitron', monospace;
    color: var(--neon-magenta);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
    text-shadow: 0 0 8px var(--neon-magenta);
    border-bottom: 1px solid var(--neon-magenta);
    padding-bottom: 8px;
    text-align: center;
    
    /* IMPORTANTE: No crecer, mantener tamaño fijo */
    flex-shrink: 0;
}

.scene-description {
    color: var(--text-primary);
    font-family: 'Rajdhani', monospace;
    font-size: 1.1rem;
    line-height: 1.6;
    font-weight: 400;
}

.scene-description h1, .scene-description h2, .scene-description h3 {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
    margin: 15px 0 10px 0;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.scene-description strong {
    color: var(--neon-yellow);
    text-shadow: 0 0 5px var(--neon-yellow);
}

.scene-description em {
    color: var(--neon-green);
    font-style: normal;
    text-shadow: 0 0 3px var(--neon-green);
}

.scene-description ul {
    list-style: none;
    padding-left: 0;
    margin: 12px 0;
}

/* Nested list indentation */
.scene-description ul ul {
    margin: 6px 0;
    padding-left: 24px;
}

.scene-description ul ul ul {
    padding-left: 20px;
}

.scene-description li {
    position: relative;
    padding-left: 20px;
    margin: 8px 0;
}

/* Different bullets for different nesting levels */
.scene-description li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
}

.scene-description ul ul li::before {
    content: '◦';
    color: var(--neon-magenta);
    text-shadow: 0 0 5px var(--neon-magenta);
}

.scene-description ul ul ul li::before {
    content: '▪';
    color: var(--neon-yellow);
    text-shadow: 0 0 5px var(--neon-yellow);
}

/* 80s Neon Horizontal Rules */
.scene-description hr {
    border: none;
    height: 2px;
    margin: 20px 0;
    background: linear-gradient(
        90deg, 
        transparent 0%, 
        var(--neon-cyan) 20%, 
        var(--neon-magenta) 50%, 
        var(--neon-cyan) 80%, 
        transparent 100%
    );
    box-shadow: 
        0 0 8px var(--neon-cyan),
        0 0 16px rgba(0, 229, 255, 0.5),
        0 0 24px rgba(233, 30, 99, 0.3);
    position: relative;
    overflow: visible;
}

.scene-description hr::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 229, 255, 0.3) 20%,
        rgba(233, 30, 99, 0.3) 50%,
        rgba(0, 229, 255, 0.3) 80%,
        transparent 100%
    );
    filter: blur(2px);
}

/* Scene scrolling styles - Full Height Distribution */
.scene-description {
    /* CRÍTICO: Ocupar todo el espacio restante después del title */
    flex: 1;
    
    /* Scroll interno cuando sea necesario */
    overflow-y: auto;
    overflow-x: hidden;
    
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 0, 0.2);
    
    /* Importante para flexbox */
    min-height: 0;
}

/* Custom scrollbar for scene content */
.scene-description::-webkit-scrollbar {
    width: 6px;
}

.scene-description::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.scene-description::-webkit-scrollbar-thumb {
    background: var(--neon-yellow);
    border-radius: 3px;
    opacity: 0.7;
}

.scene-description::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* Responsive Design - Tablet Optimization (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .header {
        padding: 8px 15px;
        cursor: pointer;
    }
    
    .header h1 {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }
    
    .audio-panel {
        height: auto;
        max-height: 50vh;
        flex: 0 1 auto;
        border-right: none;
        border-bottom: 3px solid var(--neon-cyan);
        box-shadow: 0 3px 15px rgba(0, 255, 255, 0.2);
        padding: 15px;
        overflow-y: auto;
    }
    
    .scene-panel {
        flex: 1 1 auto;
        height: auto;
        overflow: visible;
    }
    
    /* Optimize button grids for tablet */
    .audio-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
    }
    
    /* Compact section titles in tablet */
    .bgm-section h2,
    .sfx-section h2,
    .volume-section h2 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    /* Reference tabs optimization */
    .ref-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .ref-tab {
        font-size: 0.9rem;
        padding: 10px 16px;
        flex: 0 1 auto;
        min-width: 120px;
    }
    
    /* Scene panel optimization */
    .scene-panel {
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    .scene-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    
    .scene-description {
        max-height: none;
        flex: 1;
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .scene-title {
        display: none;
    }
    
    /* Larger touch targets for tablet */
    .scene-nav-btn {
        min-width: 100px;
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .scene-counter {
        font-size: 1rem;
        padding: 10px 16px;
        min-width: 140px;
    }
    
    /* Volume controls side by side on tablet */
    .volume-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .volume-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .volume-group input[type="range"] {
        width: 100%;
    }
}

/* Responsive Design - Smaller Tablets and Large Phones */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }
    
    .audio-panel {
        height: auto;
        max-height: 50vh;
        flex: 0 1 auto;
        border-right: none;
        border-bottom: 3px solid var(--neon-cyan);
        box-shadow: 0 3px 15px rgba(0, 255, 255, 0.2);
        overflow-y: auto;
    }
    
    .audio-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .scene-panel {
        flex: 1 1 auto;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    .scene-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    
    .scene-description {
        max-height: none;
        flex: 1;
    }
    
    .scene-title {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 8px 15px;
        cursor: pointer;
    }
    
    .header h1 {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .scene-title {
        display: none;
    }
    
    .audio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .volume-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .volume-group {
        width: 100%;
    }
    
    .container {
        padding: 10px;
    }
    
    /* Scene selector dropdown adjustments */
    .scene-selector-dropdown {
        min-width: 260px;
        max-width: 90vw;
        max-height: 60vh;
    }
    
    .scene-nav-btn {
        min-width: 80px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .header {
        padding: 6px 10px;
        cursor: pointer;
    }
    
    .header h1 {
        font-size: 1rem;
    }
    
    .scene-title {
        display: none;
    }
    
    .scene-navigation {
        margin-bottom: 4px;
        padding: 6px 10px;
        gap: 6px;
    }
    
    .audio-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .audio-button {
        font-size: 0.75rem;
        padding: 8px;
        min-height: 45px;
    }
    
    .scene-nav-btn {
        min-width: 60px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .scene-counter {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
    
    .scene-selector-dropdown {
        min-width: 240px;
        max-height: 50vh;
    }
    
    .scene-selector-item {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* BGM Controls */
.bgm-controls {
    margin-bottom: 20px;
}

.bgm-dropdown {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
    transition: var(--transition);
}

.bgm-dropdown:hover,
.bgm-dropdown:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 5px rgba(220, 20, 60, 0.3);
    outline: none;
}

.bgm-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}

/* Volume Controls */
.volume-slider {
    background: var(--bg-tertiary);
    height: 6px;
    border-radius: 3px;
    outline: none;
    flex: 1;
    max-width: 200px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-crimson);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(220, 20, 60, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-crimson);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px rgba(220, 20, 60, 0.5);
}

.volume-display {
    color: var(--text-accent);
    font-weight: bold;
    min-width: 40px;
}

/* Buttons */
.control-button {
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.control-button:hover:not(:disabled) {
    background: linear-gradient(145deg, var(--accent-red), var(--accent-crimson));
    border-color: var(--accent-crimson);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.control-button:active:not(:disabled) {
    transform: translateY(0);
}

.control-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.play-button:hover:not(:disabled) {
    background: linear-gradient(145deg, #2d5a2d, #4a8f4a);
}

.pause-button:hover:not(:disabled) {
    background: linear-gradient(145deg, #5a5a2d, #8f8f4a);
}

.stop-button:hover:not(:disabled),
.stop-all-button:hover:not(:disabled) {
    background: linear-gradient(145deg, var(--accent-red), #ff4444);
}

/* Now Playing */
.now-playing {
    text-align: center;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-style: italic;
    color: var(--text-secondary);
}

/* SFX Grid */
.sfx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.sfx-button {
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-secondary));
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    word-wrap: break-word;
    position: relative;
    overflow: hidden;
}

.sfx-button:hover {
    background: linear-gradient(145deg, var(--accent-red), var(--accent-crimson));
    border-color: var(--accent-crimson);
    box-shadow: var(--shadow-glow);
    transform: scale(1.05);
}

.sfx-button:active {
    transform: scale(0.95);
}

.sfx-button.playing {
    background: linear-gradient(145deg, var(--accent-crimson), var(--accent-red));
    border-color: var(--text-accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px rgba(220, 20, 60, 0.3); }
    50% { box-shadow: 0 0 20px rgba(220, 20, 60, 0.7); }
    100% { box-shadow: 0 0 5px rgba(220, 20, 60, 0.3); }
}

/* SFX Status */
.sfx-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

#active-sfx-count {
    color: var(--text-accent);
    font-weight: bold;
}

/* Master Controls */
.master-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.refresh-button:hover:not(:disabled) {
    background: linear-gradient(145deg, #2d4a5a, #4a7a8f);
}

/* Upload Section */
.upload-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.upload-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-label {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 0.9rem;
}

.file-input {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.file-input:hover {
    border-color: var(--accent-red);
}

.upload-note {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: center;
    font-style: italic;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-label {
        min-width: unset;
        margin-bottom: 5px;
    }
    
    .bgm-buttons,
    .master-buttons {
        flex-direction: column;
    }
    
    .upload-controls {
        grid-template-columns: 1fr;
    }
    
    .sfx-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .sfx-status {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .control-button {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .sfx-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}

/* File Action Links in Scene Content */
.file-action-link {
    display: inline;
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    
    /* Base neon glow */
    box-shadow: 0 0 5px rgba(0, 229, 255, 0.3);
}

.file-action-link:hover {
    transform: scale(1.05);
    text-shadow: 0 0 8px currentColor;
    
    /* Enhanced glow on hover */
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

/* BGM Action Links */
.file-action-link.bgm-link {
    background: linear-gradient(145deg, rgba(0, 229, 255, 0.1), rgba(0, 180, 200, 0.15));
    color: var(--neon-cyan);
    border-color: rgba(0, 229, 255, 0.4);
}

.file-action-link.bgm-link:hover {
    background: linear-gradient(145deg, rgba(0, 229, 255, 0.2), rgba(0, 180, 200, 0.25));
    border-color: rgba(0, 229, 255, 0.8);
    color: #ffffff;
}

/* SFX Action Links */
.file-action-link.sfx-link {
    background: linear-gradient(145deg, rgba(255, 0, 128, 0.1), rgba(200, 0, 100, 0.15));
    color: var(--neon-magenta);
    border-color: rgba(255, 0, 128, 0.4);
}

.file-action-link.sfx-link:hover {
    background: linear-gradient(145deg, rgba(255, 0, 128, 0.2), rgba(200, 0, 100, 0.25));
    border-color: rgba(255, 0, 128, 0.8);
    color: #ffffff;
}

/* Reference Action Links */
.file-action-link.ref-link {
    background: linear-gradient(145deg, rgba(255, 255, 0, 0.1), rgba(200, 200, 0, 0.15));
    color: var(--neon-yellow);
    border-color: rgba(255, 255, 0, 0.4);
}

.file-action-link.ref-link:hover {
    background: linear-gradient(145deg, rgba(255, 255, 0, 0.2), rgba(200, 200, 0, 0.25));
    border-color: rgba(255, 255, 0, 0.8);
    color: #000000;
}

/* Anchor Links (internal navigation within same scene) */
.anchor-link {
    display: inline;
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.1), rgba(60, 140, 60, 0.15));
    color: var(--neon-green);
    border-color: rgba(76, 175, 80, 0.4);
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.anchor-link:hover {
    transform: scale(1.05);
    text-shadow: 0 0 8px currentColor;
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.2), rgba(60, 140, 60, 0.25));
    border-color: rgba(76, 175, 80, 0.8);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
    color: #ffffff;
}

.anchor-link.active {
    animation: anchor-pulse 0.3s ease-out;
}

@keyframes anchor-pulse {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(76, 175, 80, 0.3); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px rgba(76, 175, 80, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 5px rgba(76, 175, 80, 0.3); }
}

/* Scene Links (navigate to different scene, scroll to top) */
.scene-link {
    display: inline;
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    
    background: linear-gradient(145deg, rgba(33, 150, 243, 0.1), rgba(20, 120, 200, 0.15));
    color: var(--neon-blue);
    border-color: rgba(33, 150, 243, 0.4);
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

.scene-link:hover {
    transform: scale(1.05);
    text-shadow: 0 0 8px currentColor;
    background: linear-gradient(145deg, rgba(33, 150, 243, 0.2), rgba(20, 120, 200, 0.25));
    border-color: rgba(33, 150, 243, 0.8);
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.6);
    color: #ffffff;
}

.scene-link.active {
    animation: scene-pulse 0.3s ease-out;
}

@keyframes scene-pulse {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(33, 150, 243, 0.3); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px rgba(33, 150, 243, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 5px rgba(33, 150, 243, 0.3); }
}

/* Scene Anchor Links (cross-scene navigation) */
.scene-anchor-link {
    display: inline;
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    
    background: linear-gradient(145deg, rgba(156, 39, 176, 0.1), rgba(120, 30, 140, 0.15));
    color: var(--neon-purple);
    border-color: rgba(156, 39, 176, 0.4);
    box-shadow: 0 0 5px rgba(156, 39, 176, 0.3);
}

.scene-anchor-link:hover {
    transform: scale(1.05);
    text-shadow: 0 0 8px currentColor;
    background: linear-gradient(145deg, rgba(156, 39, 176, 0.2), rgba(120, 30, 140, 0.25));
    border-color: rgba(156, 39, 176, 0.8);
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.6);
    color: #ffffff;
}

.scene-anchor-link.active {
    animation: scene-anchor-pulse 0.3s ease-out;
}

@keyframes scene-anchor-pulse {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(156, 39, 176, 0.3); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px rgba(156, 39, 176, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 5px rgba(156, 39, 176, 0.3); }
}

/* Scene Image Modal */
.scene-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-image-modal.active {
    opacity: 1;
    visibility: visible;
}

.scene-image-content {
    background: 
        linear-gradient(145deg, rgba(25, 25, 45, 0.95), rgba(15, 15, 35, 0.95)),
        repeating-linear-gradient(
            45deg,
            transparent 0px,
            transparent 1px,
            rgba(233, 30, 99, 0.05) 1px,
            rgba(233, 30, 99, 0.05) 2px
        );
    
    border: 2px solid var(--neon-magenta);
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 
        0 0 30px rgba(233, 30, 99, 0.3),
        0 0 60px rgba(233, 30, 99, 0.1),
        inset 0 0 20px rgba(233, 30, 99, 0.05);
    
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.scene-image-modal.active .scene-image-content {
    transform: scale(1);
}

.scene-image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(233, 30, 99, 0.1));
    border-bottom: 1px solid rgba(233, 30, 99, 0.3);
}

.scene-image-title {
    font-family: 'Orbitron', monospace;
    color: var(--neon-magenta);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-magenta);
}

.scene-image-close-btn {
    background: transparent;
    border: 1px solid var(--neon-magenta);
    color: var(--neon-magenta);
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.scene-image-close-btn:hover {
    background: var(--neon-magenta);
    color: var(--bg-primary);
    box-shadow: 0 0 15px rgba(233, 30, 99, 0.5);
    transform: scale(1.1);
}

.scene-image-display {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.scene-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 
        0 0 20px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(233, 30, 99, 0.2);
    
    /* 80s-style image filter */
    filter: 
        contrast(1.1) 
        saturate(1.2) 
        brightness(1.05)
        sepia(0.1);
    
    transition: var(--transition);
}

.scene-image:hover {
    transform: scale(1.02);
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(233, 30, 99, 0.3);
}

/* Active state for clicked links */
.file-action-link.active {
    animation: file-link-pulse 0.5s ease;
}

@keyframes file-link-pulse {
    0% { transform: scale(1.05); box-shadow: 0 0 15px currentColor; }
    50% { transform: scale(1.1); box-shadow: 0 0 25px currentColor; }
    100% { transform: scale(1.05); box-shadow: 0 0 15px currentColor; }
}

/* Tooltip styling for file links */
.file-action-link::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
    margin-bottom: 5px;
}

.file-action-link:hover::after {
    opacity: 1;
}